2017-01-21 12:15:56 -05:00
|
|
|
# Test that int.from_bytes() for small number of bytes generates
|
|
|
|
# small int.
|
|
|
|
import micropython
|
|
|
|
|
|
|
|
micropython.heap_lock()
|
|
|
|
print(int.from_bytes(b"1", "little"))
|
|
|
|
print(int.from_bytes(b"12", "little"))
|
2017-05-05 07:44:12 -04:00
|
|
|
print(int.from_bytes(b"2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "little"))
|
2017-01-21 12:15:56 -05:00
|
|
|
micropython.heap_unlock()
|