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:
Paul Sokolovsky 2017-01-21 20:15:56 +03:00
parent 3b09dca046
commit bd3dd9296b
2 changed files with 10 additions and 0 deletions

View File

@ -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()

View File

@ -0,0 +1,2 @@
49
12849