Skip to content

Commit d5f42c9

Browse files
committed
tests/basics: Add more list tests to improve coverage testing.
1 parent 3c82d1d commit d5f42c9

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

tests/basics/list1.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@
2222
print(x[1:])
2323
print(x[:-1])
2424
print(x[2:3])
25+
26+
# unsupported type on RHS of add
27+
try:
28+
[] + None
29+
except TypeError:
30+
print('TypeError')

tests/basics/list_mult.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@
1010
a = [1, 2, 3]
1111
c = a * 3
1212
print(a, c)
13+
14+
# unsupported type on RHS
15+
try:
16+
[] * None
17+
except TypeError:
18+
print('TypeError')

tests/basics/list_pop.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,9 @@
99
print("IndexError raised")
1010
else:
1111
raise AssertionError("No IndexError raised")
12+
13+
# popping such that list storage shrinks (tests implementation detail of uPy)
14+
l = list(range(20))
15+
for i in range(len(l)):
16+
l.pop()
17+
print(l)

0 commit comments

Comments
 (0)