Skip to content

Commit 719f8c0

Browse files
committed
tests/struct1: Add testcase for an unknown type char.
1 parent e53fb1b commit 719f8c0

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/basics/struct1.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@
6262
except TypeError:
6363
print('TypeError')
6464

65+
# make sure that unknown types are detected
66+
try:
67+
struct.pack("z", 1)
68+
except:
69+
print("Unknown type")
70+
6571
# Initially repitition counters were supported only for strings,
6672
# but later were implemented for all.
6773
print(struct.unpack("<3B2h", b"foo\x12\x34\xff\xff"))

0 commit comments

Comments
 (0)