diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basics/struct1.py | 4 | ||||
-rw-r--r-- | tests/misc/recursion.py | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/basics/struct1.py b/tests/basics/struct1.py index b114a789b5..c3049c55d6 100644 --- a/tests/basics/struct1.py +++ b/tests/basics/struct1.py @@ -21,3 +21,7 @@ print(struct.calcsize("100sI")) print(struct.calcsize("97sI")) print(struct.unpack("<6sH", b"foo\0\0\0\x12\x34")) print(struct.pack("<6sH", b"foo", 10000)) + +s = struct.pack("BHBI", 10, 100, 200, 300) +v = struct.unpack("BHBI", s) +print(v == (10, 100, 200, 300)) 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") |