mirror of
https://github.com/micropython/micropython.git
synced 2025-08-19 17:10:36 +02:00
tests/basics: Add tests for int.from_bytes when src has trailing zeros.
The trailing zeros should be truncated from the converted value.
This commit is contained in:
@@ -7,3 +7,6 @@ ib = int.from_bytes(b, "big")
|
||||
print(il)
|
||||
print(ib)
|
||||
print(il.to_bytes(20, "little"))
|
||||
|
||||
# check that extra zero bytes don't change the internal int value
|
||||
print(int.from_bytes(b + bytes(10), "little") == int.from_bytes(b, "little"))
|
||||
|
Reference in New Issue
Block a user