|
51 | 51 | [:newline]
|
52 | 52 | " " [:value ":f" 7] " = " [:value "[2 3]" 8]
|
53 | 53 | [:newline] [:newline]
|
54 |
| - #"--- View mode" [:newline] " ●normal object pretty"]) |
| 54 | + #"--- View mode" [:newline] " ●normal object pretty sort-maps"]) |
55 | 55 |
|
56 | 56 | (def long-sequence (range 70))
|
57 | 57 | (def long-vector (vec (range 70)))
|
|
1376 | 1376 | " " [:value "_first" pos?] " = " [:value "1" pos?] [:newline]
|
1377 | 1377 | " " [:value "_hash" pos?] " = " [:value "0" pos?] [:newline]])
|
1378 | 1378 | (section rendered "Instance fields"))
|
1379 |
| - (is+ [#"--- View mode" [:newline] " normal ●object pretty"] |
| 1379 | + (is+ [#"--- View mode" [:newline] " normal ●object pretty sort-maps"] |
1380 | 1380 | (section rendered "View mode")))
|
1381 | 1381 |
|
1382 | 1382 | (let [rendered (-> (atom "foo")
|
|
1391 | 1391 | " " [:value "validator" pos?] " = " [:value "nil" pos?] [:newline]
|
1392 | 1392 | " " [:value "watches" pos?] " = " [:value "{}" pos?]])
|
1393 | 1393 | (section rendered "Instance fields"))
|
1394 |
| - (is+ [#"--- View mode" [:newline] " normal ●object pretty"] |
| 1394 | + (is+ [#"--- View mode" [:newline] " normal ●object pretty sort-maps"] |
1395 | 1395 | (section rendered "View mode"))))
|
1396 | 1396 |
|
1397 | 1397 | (testing "navigating away from an object changes the view mode back to normal"
|
|
1430 | 1430 | " | " [:value "4" pos?] " | " [:value "-4" pos?] " | "
|
1431 | 1431 | [:value "\"444\"" pos?] " | " [:value "(4 3 2 1)" pos?] " | "]
|
1432 | 1432 | (contents-section rendered))
|
1433 |
| - (is+ [#"--- View mode" [:newline] " normal ●table object pretty"] |
| 1433 | + (is+ [#"--- View mode" [:newline] " normal ●table object pretty sort-maps"] |
1434 | 1434 | (section rendered "View mode"))))
|
1435 | 1435 |
|
1436 | 1436 | (testing "in :table view-mode lists of vectors are rendered as tables"
|
|
1454 | 1454 | " | " [:value "4" pos?] " | " [:value "-4" pos?] " | "
|
1455 | 1455 | [:value "\"444\"" pos?] " | " [:value "(4 3 2 1)" pos?] " | "]
|
1456 | 1456 | (contents-section rendered))
|
1457 |
| - (is+ [#"--- View mode" [:newline] " normal ●table object pretty"] |
| 1457 | + (is+ [#"--- View mode" [:newline] " normal ●table object pretty sort-maps"] |
1458 | 1458 | (section rendered "View mode"))))
|
1459 | 1459 |
|
1460 | 1460 | (testing "breaks if table mode is requested for unsupported value"
|
|
1532 | 1532 | " 0x00000050 │ 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f │ PQRSTUVWXYZ[\\]^_" [:newline]
|
1533 | 1533 | " 0x00000060 │ 60 61 62 63 │ `abc"]
|
1534 | 1534 | (contents-section rendered))
|
1535 |
| - (is+ [#"--- View mode" [:newline] " ●hex normal object pretty"] |
| 1535 | + (is+ [#"--- View mode" [:newline] " ●hex normal object pretty sort-maps"] |
1536 | 1536 | (section rendered "View mode"))))
|
1537 | 1537 |
|
1538 | 1538 | (testing "works with paging"
|
|
1580 | 1580 |
|
1581 | 1581 | (deftest toggle-view-mode-test
|
1582 | 1582 | (is+ :normal (-> (repeat 10 [1 2]) inspect :view-mode))
|
1583 |
| - (is+ " ●normal table object pretty" |
| 1583 | + (is+ " ●normal table object pretty sort-maps" |
1584 | 1584 | (-> (repeat 10 [1 2]) inspect render (section "View mode") last))
|
1585 | 1585 |
|
1586 | 1586 | (is+ :table (-> (repeat 10 [1 2]) inspect inspect/toggle-view-mode :view-mode))
|
1587 |
| - (is+ " normal ●table object pretty" |
| 1587 | + (is+ " normal ●table object pretty sort-maps" |
1588 | 1588 | (-> (repeat 10 [1 2]) inspect inspect/toggle-view-mode render (section "View mode") last))
|
1589 | 1589 |
|
1590 | 1590 | (is+ :object (-> (repeat 10 [1 2]) inspect inspect/toggle-view-mode inspect/toggle-view-mode :view-mode))
|
1591 |
| - (is+ " normal table ●object pretty" |
| 1591 | + (is+ " normal table ●object pretty sort-maps" |
1592 | 1592 | (-> (repeat 10 [1 2]) inspect inspect/toggle-view-mode inspect/toggle-view-mode render (section "View mode") last))
|
1593 | 1593 |
|
1594 | 1594 | (is+ :normal (-> (repeat 10 [1 2]) inspect inspect/toggle-view-mode inspect/toggle-view-mode inspect/toggle-view-mode :view-mode))
|
1595 | 1595 |
|
1596 |
| - (is+ " ●normal table object ●pretty" |
| 1596 | + (is+ " ●normal table object ●pretty sort-maps" |
1597 | 1597 | (-> (repeat 10 [1 2]) (inspect {:pretty-print true}) render (section "View mode") last)))
|
1598 | 1598 |
|
1599 | 1599 | (deftest pretty-print-map-test
|
|
1619 | 1619 | " {:a -1, :bb \"111\", :ccc [1]}\n"
|
1620 | 1620 | " {:a 2, :bb \"222\", :ccc [1 2]}]") 8]]
|
1621 | 1621 | (contents-section rendered))
|
1622 |
| - (is+ [#"--- View mode" [:newline] " ●normal object ●pretty"] |
| 1622 | + (is+ [#"--- View mode" [:newline] " ●normal object ●pretty sort-maps"] |
1623 | 1623 | (section rendered "View mode")))))
|
1624 | 1624 |
|
1625 | 1625 | (deftest pretty-print-map-in-object-view-test
|
|
1668 | 1668 | ":ccc (3 2 1)}\n {:a -4, :bb \"444\", "
|
1669 | 1669 | ":ccc (4 3 2 1)})}") 2]]
|
1670 | 1670 | (contents-section rendered))
|
1671 |
| - (is+ [#"--- View mode" [:newline] " ●normal table object ●pretty"] |
| 1671 | + (is+ [#"--- View mode" [:newline] " ●normal table object ●pretty sort-maps"] |
1672 | 1672 | (section rendered "View mode")))))
|
1673 | 1673 |
|
1674 | 1674 | (deftest pretty-print-map-as-key-test
|
|
1706 | 1706 | "\"333\", :ccc [3 2 1]}\n {:a -4, :bb "
|
1707 | 1707 | "\"444\", :ccc [4 3 2 1]}]}") 2]]
|
1708 | 1708 | (contents-section rendered))
|
1709 |
| - (is+ [#"--- View mode" [:newline] " ●normal object ●pretty"] |
| 1709 | + (is+ [#"--- View mode" [:newline] " ●normal object ●pretty sort-maps"] |
1710 | 1710 | (section rendered "View mode")))))
|
1711 | 1711 |
|
1712 | 1712 | (deftest pretty-print-seq-of-map-as-key-test
|
|
1736 | 1736 | ":bb \"111\", :ccc [1]}\n {:a 2, :bb \"222\", "
|
1737 | 1737 | ":ccc [1 2]}]}") 2]]
|
1738 | 1738 | (contents-section rendered))
|
1739 |
| - (is+ [#"--- View mode" [:newline] " ●normal object ●pretty"] |
| 1739 | + (is+ [#"--- View mode" [:newline] " ●normal object ●pretty sort-maps"] |
1740 | 1740 | (section rendered "View mode")))))
|
1741 | 1741 |
|
1742 | 1742 | (deftest sort-maps-test
|
1743 | 1743 | (testing "with :sort-map-keys enabled, map keys are sorted"
|
1744 |
| - (is+ (matchers/prefix |
1745 |
| - ["--- Contents:" [:newline] |
1746 |
| - " " [:value "0" pos?] " = " [:value "0" pos?] [:newline] |
1747 |
| - " " [:value "1" pos?] " = " [:value "1" pos?] [:newline] |
1748 |
| - " " [:value "2" pos?] " = " [:value "2" pos?] [:newline] |
1749 |
| - " " [:value "3" pos?] " = " [:value "3" pos?] [:newline]]) |
1750 |
| - (-> (zipmap (range 100) (range 100)) |
1751 |
| - inspect |
1752 |
| - (inspect/refresh {:sort-maps true}) |
1753 |
| - render |
1754 |
| - contents-section))) |
| 1744 | + (let [rendered (-> (zipmap (range 100) (range 100)) |
| 1745 | + inspect |
| 1746 | + (inspect/refresh {:sort-maps true}) |
| 1747 | + render)] |
| 1748 | + (is+ (matchers/prefix |
| 1749 | + ["--- Contents:" [:newline] |
| 1750 | + " " [:value "0" pos?] " = " [:value "0" pos?] [:newline] |
| 1751 | + " " [:value "1" pos?] " = " [:value "1" pos?] [:newline] |
| 1752 | + " " [:value "2" pos?] " = " [:value "2" pos?] [:newline] |
| 1753 | + " " [:value "3" pos?] " = " [:value "3" pos?] [:newline]]) |
| 1754 | + (contents-section rendered)) |
| 1755 | + |
| 1756 | + (is+ [#"--- View mode" [:newline] " ●normal object pretty ●sort-maps"] |
| 1757 | + (section rendered "View mode")))) |
1755 | 1758 |
|
1756 | 1759 | (testing "works if map is smaller than page size"
|
1757 | 1760 | (is+ ["--- Contents:" [:newline]
|
|
2004 | 2007 | " 3. " [:value "#±[3 ~~ 4]" pos?]]
|
2005 | 2008 | (section rendered "Diff"))
|
2006 | 2009 |
|
2007 |
| - (is+ [string? [:newline] " ●normal pretty only-diff"] |
| 2010 | + (is+ [string? [:newline] " ●normal pretty sort-maps only-diff"] |
2008 | 2011 | (section rendered "View mode")))
|
2009 | 2012 |
|
2010 | 2013 | (is+ ["--- Diff contents:" [:newline]
|
|
2051 | 2054 | " 3. " [:value "#±[3 ~~ 4]" pos?]]
|
2052 | 2055 | (section rendered "Diff"))
|
2053 | 2056 |
|
2054 |
| - (is+ [string? [:newline] " ●normal pretty ●only-diff"] |
| 2057 | + (is+ [string? [:newline] " ●normal pretty sort-maps ●only-diff"] |
2055 | 2058 | (section rendered "View mode")))
|
2056 | 2059 |
|
2057 | 2060 | (is+ ["--- Diff contents:" [:newline]
|
|
0 commit comments