summaryrefslogtreecommitdiffstatshomepage
path: root/tests
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-05-12 23:45:50 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-05-12 23:45:50 +0300
commitdf94b717b42bea39c1794a38bc10254e4f924e22 (patch)
tree655c5625d518cf15a5969bed426eff9d504f65e8 /tests
parent147c80bf7cad0f8e02f3b7ccf8ec14e65092e52b (diff)
downloadmicropython-df94b717b42bea39c1794a38bc10254e4f924e22.tar.gz
micropython-df94b717b42bea39c1794a38bc10254e4f924e22.zip
modstruct: Implement count specifier for strings (e.g. "100s").
Infra for counts of other types is there, need last mile to be implemented.
Diffstat (limited to 'tests')
-rw-r--r--tests/basics/struct1.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/basics/struct1.py b/tests/basics/struct1.py
index 3a05c85f0b..b114a789b5 100644
--- a/tests/basics/struct1.py
+++ b/tests/basics/struct1.py
@@ -16,3 +16,8 @@ print(struct.pack(">b", 1))
print(struct.pack("<bI", -128, 256))
print(struct.pack(">bI", -128, 256))
+
+print(struct.calcsize("100sI"))
+print(struct.calcsize("97sI"))
+print(struct.unpack("<6sH", b"foo\0\0\0\x12\x34"))
+print(struct.pack("<6sH", b"foo", 10000))