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.
pull/2802/head
Paul Sokolovsky 2017-01-21 20:15:56 +03:00
rodzic 3b09dca046
commit bd3dd9296b
2 zmienionych plików z 10 dodań i 0 usunięć

Wyświetl plik

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

Wyświetl plik

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