File tree Expand file tree Collapse file tree 3 files changed +32
-6
lines changed Expand file tree Collapse file tree 3 files changed +32
-6
lines changed Original file line number Diff line number Diff line change @@ -9085,9 +9085,12 @@ reduces them without incurring seq initialization"
9085
9085
(set? other)
9086
9086
(== (count coll) (count other))
9087
9087
^boolean
9088
- (reduce-kv
9089
- #(or (contains? other %2 ) (reduced false ))
9090
- true hash-map)))
9088
+ (try
9089
+ (reduce-kv
9090
+ #(or (contains? other %2 ) (reduced false ))
9091
+ true hash-map)
9092
+ (catch js/Error ex
9093
+ false ))))
9091
9094
9092
9095
IHash
9093
9096
(-hash [coll] (caching-hash coll hash-unordered-coll __hash))
@@ -9236,9 +9239,12 @@ reduces them without incurring seq initialization"
9236
9239
(set? other)
9237
9240
(== (count coll) (count other))
9238
9241
^boolean
9239
- (reduce-kv
9240
- #(or (contains? other %2 ) (reduced false ))
9241
- true tree-map)))
9242
+ (try
9243
+ (reduce-kv
9244
+ #(or (contains? other %2 ) (reduced false ))
9245
+ true tree-map)
9246
+ (catch js/Error ex
9247
+ false ))))
9242
9248
9243
9249
IHash
9244
9250
(-hash [coll] (caching-hash coll hash-unordered-coll __hash))
Original file line number Diff line number Diff line change
1
+ (ns cljs.set-equiv-test
2
+ (:refer-clojure :exclude [iter])
3
+ (:require [cljs.test :refer-macros [deftest testing is]]
4
+ [clojure.string :as s]
5
+ [clojure.set :as set]))
6
+
7
+ (deftest test-set-equality
8
+ (testing " Testing set equality"
9
+ (is (= (sorted-set 3 2 1 ) (sorted-set 1 2 3 )))
10
+ (is (= (hash-set 3 2 1 ) (sorted-set 1 2 3 )))
11
+ (is (= (sorted-set :a :b :c ) (hash-set :a :b :c )))
12
+ (is (= (hash-set :a :b :c ) (hash-set :a :b :c ))))
13
+
14
+ (testing " CLJS-2731 uncomparable values"
15
+ (is (not= (sorted-set 3 2 1 ) (sorted-set :a :b :c )))
16
+ (is (not= (hash-set 3 2 1 ) (sorted-set :a :b :c )))
17
+ (is (not= (sorted-set 3 2 1 ) (hash-set :a :b :c )))
18
+ (is (not= (hash-set 3 2 1 ) (hash-set :a :b :c )))))
Original file line number Diff line number Diff line change 303
303
[cljs.clojure-alias-test]
304
304
[cljs.hash-map-test]
305
305
[cljs.map-entry-test]
306
+ [cljs.set-equiv-test]
306
307
[cljs.syntax-quote-test]
307
308
[cljs.predicates-test]
308
309
[cljs.test-test]
345
346
'cljs.clojure-alias-test
346
347
'cljs.hash-map-test
347
348
'cljs.map-entry-test
349
+ 'cljs.set-equiv-test
348
350
'cljs.syntax-quote-test
349
351
'cljs.predicates-test
350
352
'cljs.test-test
You can’t perform that action at this time.
0 commit comments