diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-08 23:11:51 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-08 23:11:51 +0100 |
commit | 803b9263ab1049d19d62d9a09e5f82084b7afa41 (patch) | |
tree | 1f97f3f4a1fabea34327d1af4db520a348f29dbe /tests/basics | |
parent | eec91057b827013a3e02c51b60e46c8597295132 (diff) | |
parent | a985b4593d3f0c788c5e6ef0066bf82ae550cfb8 (diff) | |
download | micropython-803b9263ab1049d19d62d9a09e5f82084b7afa41.tar.gz micropython-803b9263ab1049d19d62d9a09e5f82084b7afa41.zip |
Merge branch 'master' of github.com:micropython/micropython
Diffstat (limited to 'tests/basics')
-rw-r--r-- | tests/basics/int-bytes.py | 6 |
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")) |