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

tests: Add test for int.from_bytes() for arbitrary-precision integer.

This test works only for MICROPY_LONGINT_IMPL == MICROPY_LONGINT_IMPL_MPZ
and needs a way of skipping in other cases.
parent e6ab43e2
No related branches found
No related tags found
No related merge requests found
b = bytes(range(20))
il = int.from_bytes(b, "little")
ib = int.from_bytes(b, "big")
print(il)
print(ib)
print(il.to_bytes(20, "little"))
...@@ -2,8 +2,3 @@ try: ...@@ -2,8 +2,3 @@ try:
print((10).to_bytes(1, "big")) print((10).to_bytes(1, "big"))
except Exception as e: except Exception as e:
print(type(e)) print(type(e))
try:
print(int.from_bytes(b"\0", "big"))
except Exception as e:
print(type(e))
<class 'NotImplementedError'> <class 'NotImplementedError'>
<class 'NotImplementedError'>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment