diff options
Diffstat (limited to 'tests/basics/struct1.py')
-rw-r--r-- | tests/basics/struct1.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/basics/struct1.py b/tests/basics/struct1.py index a442beb1e5..2cf75137b8 100644 --- a/tests/basics/struct1.py +++ b/tests/basics/struct1.py @@ -39,6 +39,12 @@ print(v == (10, 100, 200, 300)) # network byte order print(struct.pack('!i', 123)) +# check that we get an error if the buffer is too small +try: + struct.unpack('I', b'\x00\x00\x00') +except: + print('struct.error') + # first arg must be a string try: struct.pack(1, 2) |