tests/basics: Add more list tests to improve coverage testing.

pull/2384/head
Damien George 2016-08-15 10:46:35 +10:00
rodzic 3c82d1d34b
commit d5f42c9daf
3 zmienionych plików z 18 dodań i 0 usunięć

Wyświetl plik

@ -22,3 +22,9 @@ print(x)
print(x[1:])
print(x[:-1])
print(x[2:3])
# unsupported type on RHS of add
try:
[] + None
except TypeError:
print('TypeError')

Wyświetl plik

@ -10,3 +10,9 @@ for i in (-4, -2, 0, 2, 4):
a = [1, 2, 3]
c = a * 3
print(a, c)
# unsupported type on RHS
try:
[] * None
except TypeError:
print('TypeError')

Wyświetl plik

@ -9,3 +9,9 @@ except IndexError:
print("IndexError raised")
else:
raise AssertionError("No IndexError raised")
# popping such that list storage shrinks (tests implementation detail of uPy)
l = list(range(20))
for i in range(len(l)):
l.pop()
print(l)