Skip to content

Commit dadba06

Browse files
committed
- test-obj-map in collections test
- cleanup ns form
1 parent e4bc146 commit dadba06

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/test/cljs/cljs/collections_test.cljs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@
99
(ns cljs.collections-test
1010
(:refer-clojure :exclude [iter])
1111
(:require [cljs.test :refer-macros [deftest testing is are run-tests]]
12-
[clojure.test.check :as tc]
1312
[clojure.test.check.clojure-test :refer-macros [defspec]]
1413
[clojure.test.check.generators :as gen]
15-
[clojure.test.check.properties :as prop :include-macros true]
16-
[clojure.string :as s]
17-
[clojure.set :as set]))
14+
[clojure.test.check.properties :as prop :include-macros true]))
1815

1916
(deftest test-map-operations
2017
(testing "Test basic map collection operations"
@@ -1157,6 +1154,22 @@
11571154
(let [things (zipmap (range 15000) (repeat 0))]
11581155
(is (zero? (count (filter #(-> % key string?) things))))))
11591156

1157+
(deftest test-obj-map
1158+
(let [a (obj-map)]
1159+
(is (empty? a))
1160+
(is (zero? (count a))))
1161+
(let [b (obj-map :a 1)]
1162+
(is (not (empty? b)))
1163+
(is (== 1 (count b))))
1164+
(let [c (obj-map :a 1 :b 2 :c 3)]
1165+
(is (== 3 (count c)))
1166+
(is (= 1 (get c :a)))
1167+
(is (= 1 (:a c)))
1168+
(is (every? keyword? (keys c)))
1169+
(is (= (set [:a :b :c]) (set (keys c)))))
1170+
(is (= (obj-map :a 1 :b 2 :c 3)
1171+
(obj-map :a 1 :b 2 :c 3))))
1172+
11601173
(comment
11611174

11621175
(run-tests)

0 commit comments

Comments
 (0)