diff options
Diffstat (limited to 'tests/basics')
| -rw-r--r-- | tests/basics/bytes_add.py | 9 | ||||
| -rw-r--r-- | tests/basics/bytes_compare2.py | 11 |
2 files changed, 17 insertions, 3 deletions
diff --git a/tests/basics/bytes_add.py b/tests/basics/bytes_add.py new file mode 100644 index 000000000..1288d5ac3 --- /dev/null +++ b/tests/basics/bytes_add.py @@ -0,0 +1,9 @@ +# test bytes + other + +print(b"123" + b"456") +print(b"123" + bytearray(2)) + +import array + +print(b"123" + array.array('i', [1])) +print(b"\x01\x02" + array.array('b', [1, 2])) diff --git a/tests/basics/bytes_compare2.py b/tests/basics/bytes_compare2.py index 769d76b11..02516de93 100644 --- a/tests/basics/bytes_compare2.py +++ b/tests/basics/bytes_compare2.py @@ -1,7 +1,12 @@ -import array - print(b"1" == 1) print(b"123" == bytearray(b"123")) print(b"123" == "123") -# CPyhon gives False here +print(b'123' < bytearray(b"124")) +print(b'123' > bytearray(b"122")) +print(bytearray(b"23") in b"1234") + +import array + +print(array.array('b', [1, 2]) in b'\x01\x02\x03') +# CPython gives False here #print(b"\x01\x02\x03" == array.array("B", [1, 2, 3])) |
