diff options
| author | Andrey Orst <andreyorst@gmail.com> | 2020-11-08 22:48:59 +0300 |
|---|---|---|
| committer | Andrey Orst <andreyorst@gmail.com> | 2020-11-08 22:48:59 +0300 |
| commit | f9161b6b54cdaa9d773c0d0cb1b75eaf1e67318b (patch) | |
| tree | 9a7228b6313be28cbfdf3d070a4af7764b269ccc /test/core.fnl | |
| parent | 35bcc0ab3ac754e9f2ce6465c3d5c060bd5d37aa (diff) | |
feature(core): add hash-map function, and assoc meta to tables
Diffstat (limited to 'test/core.fnl')
| -rw-r--r-- | test/core.fnl | 9 |
1 files changed, 9 insertions, 0 deletions
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}))) |