tests/basics: Add more list tests to improve coverage testing.
This commit is contained in:
parent
3c82d1d34b
commit
d5f42c9daf
|
@ -22,3 +22,9 @@ print(x)
|
||||||
print(x[1:])
|
print(x[1:])
|
||||||
print(x[:-1])
|
print(x[:-1])
|
||||||
print(x[2:3])
|
print(x[2:3])
|
||||||
|
|
||||||
|
# unsupported type on RHS of add
|
||||||
|
try:
|
||||||
|
[] + None
|
||||||
|
except TypeError:
|
||||||
|
print('TypeError')
|
||||||
|
|
|
@ -10,3 +10,9 @@ for i in (-4, -2, 0, 2, 4):
|
||||||
a = [1, 2, 3]
|
a = [1, 2, 3]
|
||||||
c = a * 3
|
c = a * 3
|
||||||
print(a, c)
|
print(a, c)
|
||||||
|
|
||||||
|
# unsupported type on RHS
|
||||||
|
try:
|
||||||
|
[] * None
|
||||||
|
except TypeError:
|
||||||
|
print('TypeError')
|
||||||
|
|
|
@ -9,3 +9,9 @@ except IndexError:
|
||||||
print("IndexError raised")
|
print("IndexError raised")
|
||||||
else:
|
else:
|
||||||
raise AssertionError("No IndexError raised")
|
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)
|
||||||
|
|
Loading…
Reference in New Issue