From 719f8c044a9d30a8d9f4356af1310f18e82e5b67 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 14 May 2016 15:54:09 +0300 Subject: [PATCH] tests/struct1: Add testcase for an unknown type char. --- tests/basics/struct1.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/basics/struct1.py b/tests/basics/struct1.py index 1afea5a96f..857e171c10 100644 --- a/tests/basics/struct1.py +++ b/tests/basics/struct1.py @@ -62,6 +62,12 @@ try: except TypeError: print('TypeError') +# make sure that unknown types are detected +try: + struct.pack("z", 1) +except: + print("Unknown type") + # Initially repitition counters were supported only for strings, # but later were implemented for all. print(struct.unpack("<3B2h", b"foo\x12\x34\xff\xff"))