You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
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.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
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:
|
||||
print((10).to_bytes(1, "big"))
|
||||
except Exception as e:
|
||||
print(type(e))
|
||||
|
||||
try:
|
||||
print(int.from_bytes(b"\0", "big"))
|
||||
except Exception as e:
|
||||
print(type(e))
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
<class 'NotImplementedError'>
|
||||
<class 'NotImplementedError'>
|
||||
|
||||
Reference in New Issue
Block a user