From 3c7b63d2e141874649b5221941cba5c110e6c3b4 Mon Sep 17 00:00:00 2001 From: Vasilij Schneidermann Date: Mon, 24 Oct 2016 21:49:07 +0200 Subject: [PATCH] Ensure assoc updates maps properly --- tests/step9_try.mal | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/step9_try.mal b/tests/step9_try.mal index 254aed07..d7aa9867 100644 --- a/tests/step9_try.mal +++ b/tests/step9_try.mal @@ -260,6 +260,15 @@ (keyword? (nth (vals {"a" :abc "b" :def}) 0)) ;=>true +;; Testing whether assoc updates properly +(def! hm4 (assoc {:a 1 :b 2} :a 3 :c 1)) +(get hm4 :a) +;=>3 +(get hm4 :b) +;=>2 +(get hm4 :c) +;=>1 + ;; Testing nil as hash-map values (contains? {:abc nil} :abc) ;=>true -- 2.20.1