summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basics')
-rw-r--r--tests/basics/int-bytes.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/basics/int-bytes.py b/tests/basics/int-bytes.py
new file mode 100644
index 0000000000..45965ed464
--- /dev/null
+++ b/tests/basics/int-bytes.py
@@ -0,0 +1,6 @@
+print((10).to_bytes(1, "little"))
+print((111111).to_bytes(4, "little"))
+print((100).to_bytes(10, "little"))
+print(int.from_bytes(b"\x00\x01\0\0\0\0\0\0", "little"))
+print(int.from_bytes(b"\x01\0\0\0\0\0\0\0", "little"))
+print(int.from_bytes(b"\x00\x01\0\0\0\0\0\0", "little"))