summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/struct1.py
diff options
context:
space:
mode:
authorRami Ali <flowergrass@users.noreply.github.com>2016-12-28 15:29:21 +1100
committerDamien George <damien.p.george@gmail.com>2016-12-28 16:11:54 +1100
commit65574f817a949fea2316c335da866c1b8d20f1fb (patch)
tree382e7a3cbfb788f1e60aff9c26776bfaa1e3790c /tests/basics/struct1.py
parentea6a958393eff6999040dd3852d505ae78b96f5b (diff)
downloadmicropython-65574f817a949fea2316c335da866c1b8d20f1fb.tar.gz
micropython-65574f817a949fea2316c335da866c1b8d20f1fb.zip
tests/basics: Add tests to improve coverage of binary.c.
Diffstat (limited to 'tests/basics/struct1.py')
-rw-r--r--tests/basics/struct1.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/basics/struct1.py b/tests/basics/struct1.py
index 0eae9e3b4f..d89519a2fa 100644
--- a/tests/basics/struct1.py
+++ b/tests/basics/struct1.py
@@ -61,6 +61,10 @@ print(struct.unpack(">q", b"\xf2\x34\x56\x78\x90\x12\x34\x56"))
print(struct.unpack("<I", b"\xff\xff\xff\xff"))
print(struct.unpack("<Q", b"\xff\xff\xff\xff\xff\xff\xff\xff"))
+# check small int overflow
+print(struct.unpack("<i", b'\xff\xff\xff\x7f'))
+print(struct.unpack("<q", b'\xff\xff\xff\xff\xff\xff\xff\x7f'))
+
# network byte order
print(struct.pack('!i', 123))