Skip to content

Commit 23fed20

Browse files
committed
Add a test
1 parent 20472f1 commit 23fed20

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

integration_tests/test_list_03.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,29 @@ def test_list_02_string():
4949
for i in range(50):
5050
assert x[i] == y[i]
5151

52+
53+
def foo(x: i32) -> list[i32]:
54+
y: list[i32] = []
55+
i: i32
56+
for i in range(x):
57+
y.append(i+1)
58+
return y
59+
60+
61+
def test_list_return():
62+
x: list[i32]
63+
x = foo(2)
64+
assert x[0] == 1
65+
assert x[1] == 2
66+
x = foo(5)
67+
assert x[3] == 4
68+
assert x[4] == 5
69+
70+
5271
def verify():
5372
assert test_list_01(11) == 55
5473
assert test_list_02(50) == 3628
5574
test_list_02_string()
75+
test_list_return()
5676

5777
verify()

0 commit comments

Comments
 (0)