Commit 1d350b8a authored by Damien George's avatar Damien George
Browse files

tests: Add a few tests for bool, bytearray, float to improve coverage.

parent a488c266
......@@ -9,3 +9,9 @@ print(False or True)
# unary operators
print(+True)
print(-True)
# unsupported unary op
try:
len(False)
except TypeError:
print('TypeError')
......@@ -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
......@@ -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''
......@@ -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')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment