tests: Activate recursive_data.py test, now that io.StringIO is available.
This commit is contained in:
parent
5fba93a26b
commit
f42b3c7599
9
tests/misc/recursive_data.py
Normal file
9
tests/misc/recursive_data.py
Normal file
@ -0,0 +1,9 @@
|
||||
# This tests that printing recursive data structure doesn't lead to segfault.
|
||||
import _io as io
|
||||
|
||||
l = [1, 2, 3, None]
|
||||
l[-1] = l
|
||||
try:
|
||||
print(l, file=io.StringIO())
|
||||
except RuntimeError:
|
||||
print("RuntimeError")
|
1
tests/misc/recursive_data.py.exp
Normal file
1
tests/misc/recursive_data.py.exp
Normal file
@ -0,0 +1 @@
|
||||
RuntimeError
|
@ -1,9 +0,0 @@
|
||||
# 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")
|
Loading…
x
Reference in New Issue
Block a user