|
5 | 5 | [same.core :refer [ish? zeroish? not-zeroish? set-comparator! with-comparator]]
|
6 | 6 | [same.ish :as ish]
|
7 | 7 | [same.platform :as p]
|
8 |
| - [same.test-helpers :refer [about infinity #?@(:clj [java-map java-set])]])) |
| 8 | + [same.test-helpers :refer [about infinity]]) |
| 9 | + #?(:clj (:import [java.util HashSet HashMap]))) |
9 | 10 |
|
10 | 11 | (deftest scalar-test
|
11 | 12 | (is (ish? 1.0 1.0))
|
|
64 | 65 | (is (not (ish? #{1.0 2 \b "c" :d} #{1.01 2 \b "c" :d}))))
|
65 | 66 | #?(:clj
|
66 | 67 | (testing "Java sets"
|
67 |
| - (is (ish? (java-set 1.0 2 \b "c" :d) |
68 |
| - (java-set 1.0 2 \b "c" :d))) |
69 |
| - (is (ish? (java-set 1.0 2 \b "c" :d) |
70 |
| - (java-set (about 1) 2 \b "c" :d))) |
71 |
| - (is (not (ish? (java-set 1.0 2 \b "c" :d) |
72 |
| - (java-set 1.01 2 \b "c" :d))))))) |
| 68 | + (is (ish? (HashSet. [1.0 2 \b "c" :d]) |
| 69 | + (HashSet. [1.0 2 \b "c" :d]))) |
| 70 | + (is (ish? (HashSet. [1.0 2 \b "c" :d]) |
| 71 | + (HashSet. [(about 1) 2 \b "c" :d]))) |
| 72 | + (is (not (ish? (HashSet. [1.0 2 \b "c" :d]) |
| 73 | + (HashSet. [1.01 2 \b "c" :d]))))))) |
73 | 74 |
|
74 | 75 | (deftest map-test
|
75 | 76 | (testing "Maps of keyword-double"
|
|
86 | 87 | (is (not (ish? {1.0 2 :a "b"} {1.01 2 :a "b"}))))
|
87 | 88 | #?(:clj
|
88 | 89 | (testing "Java maps"
|
89 |
| - (is (ish? (java-map 1.0 2 :a "b") |
90 |
| - (java-map 1.0 2 :a "b"))) |
91 |
| - (is (ish? (java-map 1.0 2 :a "b") |
92 |
| - (java-map (about 1) 2 :a "b"))) |
93 |
| - (is (not (ish? (java-map 1.0 2 :a "b") |
94 |
| - (java-map 1.01 2 :a "b"))))))) |
| 90 | + (is (ish? (HashMap. {1.0 2 :a "b"}) |
| 91 | + (HashMap. {1.0 2 :a "b"}))) |
| 92 | + (is (ish? (HashMap. {1.0 2 :a "b"}) |
| 93 | + (HashMap. {(about 1) 2 :a "b"}))) |
| 94 | + (is (not (ish? (HashMap. {1.0 2 :a "b"}) |
| 95 | + (HashMap. {1.01 2 :a "b"}))))))) |
95 | 96 |
|
96 | 97 | (deftest array-test
|
97 | 98 | (testing "Arrays of doubles"
|
|
0 commit comments