Skip to content

Commit 52e623a

Browse files
Andy Fingerhutstuarthalloway
authored andcommitted
CLJ-1313: Correct a few unit tests
Signed-off-by: Stuart Halloway <[email protected]>
1 parent f1cfd82 commit 52e623a

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

test/clojure/test_clojure/agents.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
x))
166166
small-lbq (java.util.concurrent.LinkedBlockingQueue. queue-size)
167167
worker (seque small-lbq slow-seq)]
168-
(doall worker)
168+
(dorun worker)
169169
(is (= worker slow-seq))
170170
(Thread/sleep 250) ;; make sure agents have time to run or get blocked
171171
(let [queue-backlog (.size small-lbq)]

test/clojure/test_clojure/multimethods.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
(is (thrown? java.lang.IllegalArgumentException
197197
(bar ::rect ::rect))))
198198
(testing "The prefers method returns empty table w/ no prefs"
199-
(= {} (prefers bar)))
199+
(is (= {} (prefers bar))))
200200
(testing "Adding a preference to resolve it dispatches correctly"
201201
(prefer-method bar [::rect ::shape] [::shape ::rect])
202202
(is (= :rect-shape (bar ::rect ::rect))))
@@ -228,7 +228,7 @@
228228
(defmethod simple3 :a [x] :a)
229229
(defmethod simple3 :b [x] :b)
230230
(is (fn? (get-method simple3 :a)))
231-
(is (= (:a ((get-method simple3 :a) 1))))
231+
(is (= :a ((get-method simple3 :a) 1)))
232232
(is (fn? (get-method simple3 :b)))
233-
(is (= (:b ((get-method simple3 :b) 1))))
233+
(is (= :b ((get-method simple3 :b) 1)))
234234
(is (nil? (get-method simple3 :c)))))

test/clojure/test_clojure/ns_libs.clj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@
6666

6767
(deftest naming-types
6868
(testing "you cannot use a name already referred from another namespace"
69-
(is (thrown? IllegalStateException
70-
#"String already refers to: class java.lang.String"
71-
(definterface String)))
72-
(is (thrown? IllegalStateException
73-
#"StringBuffer already refers to: class java.lang.StringBuffer"
74-
(deftype StringBuffer [])))
75-
(is (thrown? IllegalStateException
76-
#"Integer already refers to: class java.lang.Integer"
77-
(defrecord Integer [])))))
69+
(is (thrown-with-msg? IllegalStateException
70+
#"String already refers to: class java.lang.String"
71+
(definterface String)))
72+
(is (thrown-with-msg? IllegalStateException
73+
#"StringBuffer already refers to: class java.lang.StringBuffer"
74+
(deftype StringBuffer [])))
75+
(is (thrown-with-msg? IllegalStateException
76+
#"Integer already refers to: class java.lang.Integer"
77+
(defrecord Integer [])))))
7878

7979
(deftest resolution
8080
(let [s (gensym)]

test/clojure/test_clojure/sequences.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
; and more...
2424

2525
(deftest test-reduce-from-chunked-into-unchunked
26-
(= [1 2 \a \b] (into [] (concat [1 2] "ab"))))
26+
(is (= [1 2 \a \b] (into [] (concat [1 2] "ab")))))
2727

2828
(deftest test-reduce
2929
(let [int+ (fn [a b] (+ (int a) (int b)))

0 commit comments

Comments
 (0)