Commit 82af4d67 authored by Damien George's avatar Damien George
Browse files

tests: Improve coverage of struct with test for non-compliant behaviour.

parent dffa383b
......@@ -103,15 +103,3 @@ try:
print(struct.unpack_from('<b', buf, -11))
except:
print('struct.error')
# pack with too many args, not checked by uPy
#try:
# print(struct.pack('ii', 1, 2, 3))
#except:
# print('struct.error')
# pack with too few args, not checked by uPy
#try:
# print(struct.pack('ii', 1))
#except:
# print('struct.error')
# tests for things that are not implemented, or have non-compliant behaviour
import array
import ustruct
# array deletion not implemented
try:
......@@ -87,3 +88,9 @@ try:
del [][2:3:4]
except NotImplementedError:
print('NotImplementedError')
# struct pack with too many args, not checked by uPy
print(ustruct.pack('bb', 1, 2, 3))
# struct pack with too few args, not checked by uPy
print(ustruct.pack('bb', 1))
......@@ -12,3 +12,5 @@ NotImplementedError
NotImplementedError
NotImplementedError
NotImplementedError
b'\x01\x02'
b'\x01\x00'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment