|
1582 | 1582 | (is (.-done (.next iter)))))
|
1583 | 1583 | (let [eiter (.entries {:foo "bar" :baz "woz"})]
|
1584 | 1584 | (testing "map entry iteration"
|
1585 |
| - (is (= (seq (.-value (.next eiter))) (seq #js [:foo "bar"]))) |
1586 |
| - (is (= (seq (.-value (.next eiter))) (seq #js [:baz "woz"]))) |
| 1585 | + (let [entries #{(seq #js [:foo "bar"]) (seq #js [:baz "woz"])}] |
| 1586 | + (is (entries (seq (.-value (.next eiter))))) |
| 1587 | + (is (entries (seq (.-value (.next eiter)))))) |
1587 | 1588 | (is (.-done (.next eiter)))))
|
1588 | 1589 | (let [iter (.values {:foo "bar" :baz "woz"})]
|
1589 | 1590 | (testing "map value iteration"
|
|
1643 | 1644 | "{:foo \"bar\"}"))
|
1644 | 1645 | (is (= (binding [*print-length* 0] (str {:foo "bar" :baz "woz"}))
|
1645 | 1646 | "{...}"))
|
1646 |
| - (is (= (binding [*print-length* 1] (str {:foo "bar" :baz "woz"})) |
1647 |
| - "{:foo \"bar\", ...}")) |
1648 |
| - (is (= (binding [*print-length* 10] (str {:foo "bar" :baz "woz"})) |
1649 |
| - "{:foo \"bar\", :baz \"woz\"}"))) |
| 1647 | + (is (#{"{:foo \"bar\", ...}" "{:baz \"woz\", ...}"} |
| 1648 | + (binding [*print-length* 1] (str {:foo "bar" :baz "woz"})))) |
| 1649 | + (is (#{"{:foo \"bar\", :baz \"woz\"}" "{:baz \"woz\", :foo \"bar\"}"} |
| 1650 | + (binding [*print-length* 10] (str {:foo "bar" :baz "woz"}))))) |
1650 | 1651 | )
|
1651 | 1652 |
|
1652 | 1653 | (deftest test-print-with-opts
|
|
1656 | 1657 | "[<MORE-MARKER>]"))
|
1657 | 1658 | (is (= (pr-str-with-opts [[1 2 3]] {:more-marker "\u2026" :print-length 1})
|
1658 | 1659 | "[1 \u2026]"))
|
1659 |
| - (is (= (pr-str-with-opts [#{1 2 3}] {:more-marker "\u2026" :print-length 2}) |
1660 |
| - "#{1 3 \u2026}")) |
| 1660 | + (is (#{"#{1 2 \u2026}" "#{1 3 \u2026}" |
| 1661 | + "#{2 1 \u2026}" "#{2 3 \u2026}" |
| 1662 | + "#{3 1 \u2026}" "#{3 2 \u2026}"} |
| 1663 | + (pr-str-with-opts [#{1 2 3}] {:more-marker "\u2026" :print-length 2}))) |
1661 | 1664 | (is (= (pr-str-with-opts ['(1 2 3)] {:more-marker "\u2026" :print-length 2})
|
1662 | 1665 | "(1 2 \u2026)"))
|
1663 |
| - (is (= (pr-str-with-opts [{:1 1 :2 2 :3 3}] {:more-marker "\u2026" :print-length 2}) |
1664 |
| - "{:1 1, :2 2, \u2026}"))) |
| 1666 | + (is (#{"{:1 1, :2 2, \u2026}" "{:1 1, :3 3, \u2026}" |
| 1667 | + "{:2 2, :1 1, \u2026}" "{:2 2, :3 3, \u2026}" |
| 1668 | + "{:3 3, :1 1, \u2026}" "{:3 3, :2 2, \u2026}"} |
| 1669 | + (pr-str-with-opts [{:1 1 :2 2 :3 3}] {:more-marker "\u2026" :print-length 2})))) |
1665 | 1670 |
|
1666 | 1671 | (testing "Testing printing with opts - :alt-impl"
|
1667 | 1672 | ; CLJS-1010
|
|
2429 | 2434 |
|
2430 | 2435 | (deftest test-739
|
2431 | 2436 | (testing "Testing CLJS-739, with-out-str"
|
2432 |
| - (set! *print-newline* true) |
2433 |
| - (is (= (with-out-str (doseq [fn (cljs-739 [] [:a :b :c :d])] (fn))) |
2434 |
| - ":a\n:b\n:c\n:d\n")) |
2435 |
| - (set! *print-newline* false))) |
| 2437 | + (binding [*print-newline* true] |
| 2438 | + (is (= (with-out-str (doseq [fn (cljs-739 [] [:a :b :c :d])] (fn))) |
| 2439 | + ":a\n:b\n:c\n:d\n"))))) |
2436 | 2440 |
|
2437 | 2441 | (deftest test-728
|
2438 | 2442 | (testing "Testing CLJS-728, lookup with default"
|
|
0 commit comments