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

pull/1444/head
Damien George 2015-08-25 18:18:57 +01:00
rodzic a488c266c3
commit 1d350b8ac6
4 zmienionych plików z 19 dodań i 0 usunięć

Wyświetl plik

@ -9,3 +9,9 @@ print(False or True)
# unary operators
print(+True)
print(-True)
# unsupported unary op
try:
len(False)
except TypeError:
print('TypeError')

Wyświetl plik

@ -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

Wyświetl plik

@ -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''

Wyświetl plik

@ -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')