Skip to content
Snippets Groups Projects
Commit bd3dd929 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

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.
parent 3b09dca0
No related branches found
No related tags found
No related merge requests found
# 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()
49
12849
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment