blob: 3310ea95d147230339f91e1531f153aa92dcb453 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
# Test that int.from_bytes() for small number of bytes generates
# small int.
try:
import micropython
micropython.heap_lock
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
micropython.heap_lock()
print(int.from_bytes(b"1", "little"))
print(int.from_bytes(b"12", "little"))
print(int.from_bytes(b"2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "little"))
micropython.heap_unlock()
|