tests/heapalloc_int_from_bytes: Test that int.from_bytes() can work w/o alloc.
For a small number of bytes, it's expected to return a small int without allocation.
This commit is contained in:
parent
3b09dca046
commit
bd3dd9296b
|
@ -0,0 +1,8 @@
|
||||||
|
# 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"))
|
||||||
|
micropython.heap_unlock()
|
|
@ -0,0 +1,2 @@
|
||||||
|
49
|
||||||
|
12849
|
Loading…
Reference in New Issue