|
349 | 349 | (is (= {"x" "y"} (meta ^{"x" "y"} [])))
|
350 | 350 | ))
|
351 | 351 |
|
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 |
| - |
367 | 352 | (deftest test-bit-operations
|
368 | 353 | (testing "Testing bit operations"
|
369 | 354 | (is (= [1 0 0 40 43 49 49])
|
|
1685 | 1670 |
|
1686 | 1671 | (defrecord PrintMe [a b])
|
1687 | 1672 |
|
1688 |
| -(deftest test-pr-str |
| 1673 | +(deftest test-printing |
1689 | 1674 | (testing "Testing pr-str"
|
| 1675 | + (is (= (pr-str) "")) |
1690 | 1676 | (is (= (pr-str 1) "1"))
|
1691 | 1677 | (is (= (pr-str -1) "-1"))
|
1692 | 1678 | (is (= (pr-str -1.5) "-1.5"))
|
|
1724 | 1710 | (is (= (pr-str uuid) (str "#uuid \"" uuid-str "\""))))
|
1725 | 1711 | ;; pr-str PersistentQueueSeq - CLJS-800
|
1726 | 1712 | (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)))))) |
1728 | 1732 |
|
1729 | 1733 | (deftest test-inext
|
1730 | 1734 | (testing "Testing INext"
|
|
0 commit comments