|
691 | 691 | (is+ (matchers/prefix table-mode-prefix)
|
692 | 692 | (value-skip-header (session/message {:op "inspect-toggle-view-mode"})))))
|
693 | 693 |
|
| 694 | +(deftest pretty-print-integration-test |
| 695 | + (testing "renders an object with the pretty printer" |
| 696 | + (session/message {:op "inspect-clear"}) |
| 697 | + (session/message {:op "eval" |
| 698 | + :inspect "true" |
| 699 | + :code "(repeat 5 {:a (repeat 5 {:b 2}) :c (repeat 5 {:d 2})})"}) |
| 700 | + (testing "toggle pretty printing and turn it on" |
| 701 | + (is+ ["--- Contents:" [:newline] |
| 702 | + " 0. " [:value (str "{:a ({:b 2} {:b 2} {:b 2} {:b 2} {:b 2})," |
| 703 | + "\n :c ({:d 2} {:d 2} {:d 2} {:d 2} {:d 2})}") 1] |
| 704 | + [:newline] |
| 705 | + " 1. " [:value (str "{:a ({:b 2} {:b 2} {:b 2} {:b 2} {:b 2})," |
| 706 | + "\n :c ({:d 2} {:d 2} {:d 2} {:d 2} {:d 2})}") 2] |
| 707 | + [:newline] |
| 708 | + " 2. " [:value (str "{:a ({:b 2} {:b 2} {:b 2} {:b 2} {:b 2})," |
| 709 | + "\n :c ({:d 2} {:d 2} {:d 2} {:d 2} {:d 2})}") 3] |
| 710 | + [:newline] |
| 711 | + " 3. " [:value (str "{:a ({:b 2} {:b 2} {:b 2} {:b 2} {:b 2})," |
| 712 | + "\n :c ({:d 2} {:d 2} {:d 2} {:d 2} {:d 2})}") 4] |
| 713 | + [:newline] |
| 714 | + " 4. " [:value (str "{:a ({:b 2} {:b 2} {:b 2} {:b 2} {:b 2})," |
| 715 | + "\n :c ({:d 2} {:d 2} {:d 2} {:d 2} {:d 2})}") 5] |
| 716 | + [:newline]] |
| 717 | + (value-skip-header (session/message {:op "inspect-toggle-pretty-print"})))) |
| 718 | + (testing "toggle pretty printing and turn it off" |
| 719 | + (is+ ["--- Contents:" [:newline] |
| 720 | + " 0. " [:value (str "{:a ({:b 2} {:b 2} {:b 2} {:b 2} {:b 2})," |
| 721 | + " :c ({:d 2} {:d 2} {:d 2} {:d 2} {:d 2})}") 1] |
| 722 | + [:newline] |
| 723 | + " 1. " [:value (str "{:a ({:b 2} {:b 2} {:b 2} {:b 2} {:b 2})," |
| 724 | + " :c ({:d 2} {:d 2} {:d 2} {:d 2} {:d 2})}") 2] |
| 725 | + [:newline] |
| 726 | + " 2. " [:value (str "{:a ({:b 2} {:b 2} {:b 2} {:b 2} {:b 2})," |
| 727 | + " :c ({:d 2} {:d 2} {:d 2} {:d 2} {:d 2})}") 3] |
| 728 | + [:newline] |
| 729 | + " 3. " [:value (str "{:a ({:b 2} {:b 2} {:b 2} {:b 2} {:b 2})," |
| 730 | + " :c ({:d 2} {:d 2} {:d 2} {:d 2} {:d 2})}") 4] |
| 731 | + [:newline] |
| 732 | + " 4. " [:value (str "{:a ({:b 2} {:b 2} {:b 2} {:b 2} {:b 2})," |
| 733 | + " :c ({:d 2} {:d 2} {:d 2} {:d 2} {:d 2})}") 5] |
| 734 | + [:newline]] |
| 735 | + (value-skip-header (session/message {:op "inspect-toggle-pretty-print"})))))) |
| 736 | + |
694 | 737 | (deftest print-length-independence-test
|
695 | 738 | (testing "*print-length* doesn't break rendering of long collections"
|
696 | 739 | (is (re-find #"showing page: \d+ of \d+"
|
|
0 commit comments