This introduces a skip_if module that can be used by tests to determine when they should be skipped due to the environment. Some tests have been split in order to have finer grained skip control.
16 lines
357 B
Python
16 lines
357 B
Python
import skip_if
|
|
skip_if.no_bigint()
|
|
|
|
print((2**64).to_bytes(9, "little"))
|
|
|
|
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"))
|
|
|
|
# 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"))
|