kopia lustrzana https://github.com/micropython/micropython
tests/int_bytes: Add tests for optional arguments.
Signed-off-by: Amirreza Hamzavi <amirrezahamzavi2000@gmail.com>pull/14387/head
rodzic
f8961ea74c
commit
ca84705f4e
|
@ -0,0 +1,9 @@
|
|||
# Check optional byteorder argument (CPython 3.11+)
|
||||
print((10).to_bytes(1))
|
||||
print((100).to_bytes(10))
|
||||
print(int.from_bytes(b"\0\0\0\0\0\0\0\0\0\x01"))
|
||||
print(int.from_bytes(b"\x01\0"))
|
||||
|
||||
# Check optional length argument (CPython 3.11+)
|
||||
print((10).to_bytes())
|
||||
print((100).to_bytes())
|
|
@ -0,0 +1,6 @@
|
|||
b'\n'
|
||||
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00d'
|
||||
1
|
||||
256
|
||||
b'\n'
|
||||
b'd'
|
Ładowanie…
Reference in New Issue