diff options
Diffstat (limited to 'tests/misc')
-rw-r--r-- | tests/misc/recursion.py | 7 | ||||
-rw-r--r-- | tests/misc/recursive_data.py_ | 9 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/misc/recursion.py b/tests/misc/recursion.py new file mode 100644 index 0000000000..227f48396a --- /dev/null +++ b/tests/misc/recursion.py @@ -0,0 +1,7 @@ +def foo(): + foo() + +try: + foo() +except RuntimeError: + print("RuntimeError") diff --git a/tests/misc/recursive_data.py_ b/tests/misc/recursive_data.py_ new file mode 100644 index 0000000000..6a52a3c0e8 --- /dev/null +++ b/tests/misc/recursive_data.py_ @@ -0,0 +1,9 @@ +# This tests that printing recursive data structure doesn't lead to segfault. +# Unfortunately, print() so far doesn't support "file "kwarg, so variable-len +# output of this test cannot be redirected, and this test cannot be validated. +l = [1, 2, 3, None] +l[-1] = l +try: + print(l) +except RuntimeError: + print("RuntimeError") |