Skip to content

Commit 829b96e

Browse files
committed
Test recursion check
1 parent 376eca0 commit 829b96e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/basilisp/test_pprint.lpy

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,14 @@
238238
5
239239
(repeat 10 (range 10))))
240240

241+
(deftest pprint-recursion-check
242+
(let [a (atom [])
243+
b (atom {:a a})]
244+
(swap! a conj b)
245+
(let [s (with-out-str
246+
(pprint/pprint a))]
247+
(is (not (nil? (re-find #"<Recursion on Atom with id=0x[0-9a-f]+>" s)))))))
248+
241249
(deftest pprint-suppress-namespaces-test
242250
(testing "no supression"
243251
(are [res expr] (= res (str/rtrim (with-out-str (pprint/pprint expr))))

0 commit comments

Comments
 (0)