diff --git a/tests/basics/bool1.py b/tests/basics/bool1.py index 99bd837927179512bf2d087166180cddc8d6924a..35d9ed8ccc0284e104177b533113b644bbf4483e 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 76e7e59753ca8d64a7f29194a0c8e069368c934d..2e47f17bf956d0fc4d76215503ded11c51180327 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 21a386c6e7932013ed10be0d0614c3e79f392658..a7e2b573742557e9337ed773a81e18d25b09ac66 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'' diff --git a/tests/float/float_divmod_relaxed.py b/tests/float/float_divmod_relaxed.py index 7054d2ca679aff5c0b130fe589694be2911f4599..a9450fa2c4d94cce340095bce349e16f8edcb1b8 100644 --- a/tests/float/float_divmod_relaxed.py +++ b/tests/float/float_divmod_relaxed.py @@ -25,3 +25,9 @@ for i in range(25): for j in range(25): y = (j - 12.5) / 6 test(x, y) + +# test division by zero error +try: + divmod(1.0, 0) +except ZeroDivisionError: + print('ZeroDivisionError')