summaryrefslogtreecommitdiff
path: root/tests/basics/struct1.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basics/struct1.py')
-rw-r--r--tests/basics/struct1.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/basics/struct1.py b/tests/basics/struct1.py
index 2cf75137b..db34342a1 100644
--- a/tests/basics/struct1.py
+++ b/tests/basics/struct1.py
@@ -69,6 +69,12 @@ print(buf)
struct.pack_into('<bbb', buf, -6, 0x44, 0x45, 0x46)
print(buf)
+# check that we get an error if the buffer is too small
+try:
+ struct.pack_into('I', bytearray(1), 0, 0)
+except:
+ print('struct.error')
+
try:
struct.pack_into('<bbb', buf, 7, 0x41, 0x42, 0x43)
except: