From f9161b6b54cdaa9d773c0d0cb1b75eaf1e67318b Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sun, 8 Nov 2020 22:48:59 +0300 Subject: feature(core): add hash-map function, and assoc meta to tables --- test/core.fnl | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/core.fnl') diff --git a/test/core.fnl b/test/core.fnl index 0609788..54b2d00 100644 --- a/test/core.fnl +++ b/test/core.fnl @@ -4,6 +4,7 @@ (local {: vec + : hash-map : apply : seq : first @@ -599,3 +600,11 @@ (assert-eq (vec 1) [1]) (assert-eq (vec 1 2 3) [1 2 3]) (assert-eq (getmetatable (vec 1 2 3)) {:cljlib/table-type :seq}))) + +(deftest hash-map + (testing hash-map + (assert* (not (pcall hash-map :a))) + (assert-eq (hash-map) {}) + (assert-eq (hash-map :a 1) {:a 1}) + (assert-eq (hash-map :a 1 :b 2 :c 3) {:a 1 :b 2 :c 3}) + (assert-eq (getmetatable (hash-map)) {:cljlib/table-type :table}))) -- cgit v1.2.3