diff options
Diffstat (limited to 'tests/basics')
-rw-r--r-- | tests/basics/bool1.py | 6 | ||||
-rw-r--r-- | tests/basics/bytearray1.py | 3 | ||||
-rw-r--r-- | tests/basics/bytearray_add.py | 4 |
3 files changed, 13 insertions, 0 deletions
diff --git a/tests/basics/bool1.py b/tests/basics/bool1.py index 99bd837927..35d9ed8ccc 100644 --- a/tests/basics/bool1.py +++ b/tests/basics/bool1.py @@ -9,3 +9,9 @@ print(False or True) # unary operators print(+True) print(-True) + +# unsupported unary op +try: + len(False) +except TypeError: + print('TypeError') diff --git a/tests/basics/bytearray1.py b/tests/basics/bytearray1.py index 76e7e59753..2e47f17bf9 100644 --- a/tests/basics/bytearray1.py +++ b/tests/basics/bytearray1.py @@ -27,4 +27,7 @@ print(bytearray([1]) == b"1") print(b"1" == bytearray([1])) print(bytearray() == bytearray()) +# comparison with other type should return False +print(bytearray() == 1) + # TODO: other comparisons diff --git a/tests/basics/bytearray_add.py b/tests/basics/bytearray_add.py index 21a386c6e7..a7e2b57374 100644 --- a/tests/basics/bytearray_add.py +++ b/tests/basics/bytearray_add.py @@ -12,3 +12,7 @@ print(b) # extend b.extend(bytearray(4)) print(b) + +# this inplace add tests the code when the buffer doesn't need to be increased +b = bytearray() +b += b'' |