tests: Test that operations return small ints.
Signed-off-by: Jeff Epler <jepler@gmail.com>
This commit is contained in:
parent
8c47e446bf
commit
c68d8ac358
1 changed files with 16 additions and 0 deletions
16
tests/micropython/smallint_intbig.py
Normal file
16
tests/micropython/smallint_intbig.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import struct
|
||||
import array
|
||||
|
||||
zero = 0
|
||||
i = struct.unpack("Q", b"\0" * 8)[0]
|
||||
print(i is zero)
|
||||
i = struct.unpack("q", b"\0" * 8)[0]
|
||||
print(i is zero)
|
||||
|
||||
i = array.array("Q", [0])[0]
|
||||
print(i is zero)
|
||||
i = array.array("q", [0])[0]
|
||||
print(i is zero)
|
||||
|
||||
i = pow(3, 3, 3)
|
||||
print(i is zero)
|
||||
Loading…
Reference in a new issue