Commit d5f42c9d authored by Damien George's avatar Damien George
Browse files

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

parent 3c82d1d3
......@@ -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')
......@@ -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')
......@@ -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)
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