Skip to content

Commit d1212bd

Browse files
committed
cljs.collection-test passing
- Set needs to assoc value to underlying hashmap - Set needs to return the value in the underlying hashmap - skip a transient test we just don't support at the moment - run the collections test - :nodejs target for lite-test, easier to flip to :simple
1 parent f122ee6 commit d1212bd

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

resources/lite_test.edn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
:npm-deps {:lodash "4.17.4"}
1010
:closure-warnings {:non-standard-jsdoc :off :global-this :off}
1111
:install-deps true
12+
:target :nodejs
1213
:language-out :es5
1314
:foreign-libs
1415
[{:file "src/test/cljs/calculator_global.js"

src/main/cljs/cljs/core.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12991,7 +12991,7 @@ reduces them without incurring seq initialization"
1299112991

1299212992
ICollection
1299312993
(-conj [coll o]
12994-
(Set. meta (assoc hash-map o nil) nil))
12994+
(Set. meta (assoc hash-map o o) nil))
1299512995

1299612996
IEmptyableCollection
1299712997
(-empty [coll] (with-meta (. Set -EMPTY) meta))
@@ -13025,7 +13025,7 @@ reduces them without incurring seq initialization"
1302513025
(-lookup coll v nil))
1302613026
(-lookup [coll v not-found]
1302713027
(if (-contains-key? hash-map v)
13028-
v
13028+
(-lookup hash-map v)
1302913029
not-found))
1303013030

1303113031
ISet

src/test/cljs/cljs/collections_test.cljs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,9 +1127,12 @@
11271127
(next (chunk-cons (chunk b) nil))))))
11281128

11291129
(deftest test-cljs-3124
1130-
(let [t (assoc! (transient []) 0 1)]
1131-
(persistent! t)
1132-
(is (= :fail (try (get t :a :not-found) (catch js/Error e :fail))))))
1130+
;; Doesn't work under :lite-mode because there are not
1131+
;; separate transient types for now
1132+
(when-not ^boolean LITE_MODE
1133+
(let [t (assoc! (transient []) 0 1)]
1134+
(persistent! t)
1135+
(is (= :fail (try (get t :a :not-found) (catch js/Error e :fail)))))))
11331136

11341137
(deftest test-cljs-3317
11351138
(testing "persistent vector invoke matches clojure"

src/test/cljs/lite_test_runner.cljs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
[cljs.new-new-test]
1515
[cljs.printing-test]
1616
[cljs.seqs-test]
17-
;; [cljs.collections-test]
17+
[cljs.collections-test]
1818
[cljs.hashing-test]
1919
[cljs.core-test]
2020
;; [cljs.chunked-seq] ;; doesn't exist in :lite-mode
@@ -78,6 +78,7 @@
7878
'cljs.printing-test
7979
'cljs.new-new-test
8080
'cljs.seqs-test
81+
'cljs.collections-test
8182
'cljs.hashing-test
8283
'cljs.core-test
8384
'cljs.interop-test ;; ES6 stuff

0 commit comments

Comments
 (0)