tests/base/struct1.py: Add test for repetition counters.

This commit is contained in:
Paul Sokolovsky 2015-10-31 18:43:55 +03:00
parent 2b080cf599
commit 0bd3f3291d
1 changed files with 5 additions and 0 deletions

View File

@ -61,3 +61,8 @@ try:
struct.pack(1, 2)
except TypeError:
print('TypeError')
# Initially repitition counters were supported only for strings,
# but later were implemented for all.
print(struct.unpack("<3B2h", b"foo\x12\x34\xff\xff"))
print(struct.pack("<3B", 1, 2, 3))