tests: Improve coverage of struct with test for non-compliant behaviour.
This commit is contained in:
parent
dffa383b06
commit
82af4d6749
@ -103,15 +103,3 @@ try:
|
|||||||
print(struct.unpack_from('<b', buf, -11))
|
print(struct.unpack_from('<b', buf, -11))
|
||||||
except:
|
except:
|
||||||
print('struct.error')
|
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')
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# tests for things that are not implemented, or have non-compliant behaviour
|
# tests for things that are not implemented, or have non-compliant behaviour
|
||||||
|
|
||||||
import array
|
import array
|
||||||
|
import ustruct
|
||||||
|
|
||||||
# array deletion not implemented
|
# array deletion not implemented
|
||||||
try:
|
try:
|
||||||
@ -87,3 +88,9 @@ try:
|
|||||||
del [][2:3:4]
|
del [][2:3:4]
|
||||||
except NotImplementedError:
|
except NotImplementedError:
|
||||||
print('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
|
NotImplementedError
|
||||||
NotImplementedError
|
NotImplementedError
|
||||||
|
b'\x01\x02'
|
||||||
|
b'\x01\x00'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user