Skip to content

Commit 7a29362

Browse files
r0mandnolen
authored andcommitted
CLJS-1629: Fix warning about duplicate test-pr-str
1 parent edce7e0 commit 7a29362

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

src/test/cljs/cljs/core_test.cljs

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -349,21 +349,6 @@
349349
(is (= {"x" "y"} (meta ^{"x" "y"} [])))
350350
))
351351

352-
(deftest test-pr-str
353-
(testing "Testing printing"
354-
(is (= "\"asdf\" \"asdf\"" (pr-str "asdf" "asdf")))
355-
(is (= "[1 true {:a 2, :b #\"x\\\"y\"} #js [3 4]]"
356-
(pr-str [1 true {:a 2 :b #"x\"y"} (array 3 4)])))
357-
(is (= "\"asdf\"\n" (prn-str "asdf")))
358-
(is (= "[1 true {:a 2, :b 42} #js [3 4]]\n"
359-
(prn-str [1 true {:a 2 :b 42} (array 3 4)])))
360-
(is (= "asdf" (print-str "asdf")))
361-
(is (= "asdf\n" (println-str "asdf")))
362-
(is (= "" (pr-str)))
363-
(is (= "\n" (prn-str)))
364-
(is (= "12" (with-out-str (print 1) (print 2))))
365-
(is (= "12" (with-out-str (*print-fn* 1) (*print-fn* 2))))))
366-
367352
(deftest test-bit-operations
368353
(testing "Testing bit operations"
369354
(is (= [1 0 0 40 43 49 49])
@@ -1685,8 +1670,9 @@
16851670

16861671
(defrecord PrintMe [a b])
16871672

1688-
(deftest test-pr-str
1673+
(deftest test-printing
16891674
(testing "Testing pr-str"
1675+
(is (= (pr-str) ""))
16901676
(is (= (pr-str 1) "1"))
16911677
(is (= (pr-str -1) "-1"))
16921678
(is (= (pr-str -1.5) "-1.5"))
@@ -1724,7 +1710,25 @@
17241710
(is (= (pr-str uuid) (str "#uuid \"" uuid-str "\""))))
17251711
;; pr-str PersistentQueueSeq - CLJS-800
17261712
(is (= (pr-str (rest (conj cljs.core.PersistentQueue.EMPTY 1 2 3))) "(2 3)"))
1727-
))
1713+
(is (= "\"asdf\" \"asdf\"" (pr-str "asdf" "asdf")))
1714+
;; Different hash map order on self-host
1715+
(is (#{"[1 true {:a 2, :b #\"x\\\"y\"} #js [3 4]]"
1716+
"[1 true {:b #\"x\\\"y\", :a 2} #js [3 4]]"}
1717+
(pr-str [1 true {:a 2 :b #"x\"y"} (array 3 4)]))))
1718+
(testing "Testing print-str"
1719+
(is (= (print-str "asdf") "asdf")))
1720+
(testing "Testing println-str"
1721+
(is (= (println-str "asdf") "asdf\n")))
1722+
(testing "Testing prn-str"
1723+
(is (= (prn-str) "\n"))
1724+
(is (= (prn-str "asdf") "\"asdf\"\n"))
1725+
;; Different hash map order on self-host
1726+
(is (#{"[1 true {:a 2, :b 42} #js [3 4]]\n"
1727+
"[1 true {:b 42, :a 2} #js [3 4]]\n"}
1728+
(prn-str [1 true {:a 2 :b 42} (array 3 4)]))))
1729+
(testing "Testing with-out-str"
1730+
(is (= "12" (with-out-str (print 1) (print 2))))
1731+
(is (= "12" (with-out-str (*print-fn* 1) (*print-fn* 2))))))
17281732

17291733
(deftest test-inext
17301734
(testing "Testing INext"

0 commit comments

Comments
 (0)