Skip to content

Commit a4c9414

Browse files
committed
Clean up new clj-kondo warnings
1 parent 0264471 commit a4c9414

File tree

4 files changed

+18
-22
lines changed

4 files changed

+18
-22
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@ pom.xml.asc
99
/checkouts/
1010
/node_modules
1111
.eastwood
12+
.clj-kondo/
1213
.lein-deps-sum
1314
.lein-repl-history
1415
.lein-plugins/
1516
.lein-failures
1617
.nrepl-port
18+
.java-version
19+
.lsp/
1720
.rebel_readline_history
1821
.DS_Store
1922
.#*

src/same/platform.cljc

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
(def max-value
77
"The largest representable non-infinite Double."
8-
#?(:clj (Double/MAX_VALUE)
8+
#?(:clj Double/MAX_VALUE
99
:cljs (.-MAX_VALUE js/Number)))
1010

1111
(defn is-array?

test/same/core_test.cljc

+14-13
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
[same.core :refer [ish? zeroish? not-zeroish? set-comparator! with-comparator]]
66
[same.ish :as ish]
77
[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])))
910

1011
(deftest scalar-test
1112
(is (ish? 1.0 1.0))
@@ -64,12 +65,12 @@
6465
(is (not (ish? #{1.0 2 \b "c" :d} #{1.01 2 \b "c" :d}))))
6566
#?(:clj
6667
(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])))))))
7374

7475
(deftest map-test
7576
(testing "Maps of keyword-double"
@@ -86,12 +87,12 @@
8687
(is (not (ish? {1.0 2 :a "b"} {1.01 2 :a "b"}))))
8788
#?(:clj
8889
(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"})))))))
9596

9697
(deftest array-test
9798
(testing "Arrays of doubles"

test/same/test_helpers.cljc

-8
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,3 @@
1919
(def nan
2020
#?(:clj Double/NaN
2121
:cljs js/NaN))
22-
23-
(defn java-set
24-
[& coll]
25-
(java.util.HashSet. ^java.util.Collection coll))
26-
27-
(defn java-map
28-
[& {:as map}]
29-
(java.util.HashMap. ^java.util.Map map))

0 commit comments

Comments
 (0)