We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a74b77 commit f8d73ddCopy full SHA for f8d73dd
integration_tests/test_list_01.py
@@ -42,8 +42,30 @@ def test_list_02():
42
for j in range(len(y)):
43
assert x[j] == y[j]
44
45
+# Negative Indexing
46
+def test_list_03():
47
+ x: list[f64] = []
48
+
49
+ i: i32
50
+ for i in range(2):
51
+ x.append(float(i))
52
53
+ assert x[1] == x[-1]
54
+ assert x[0] == x[-2]
55
+ assert x[-1] == 1.0
56
+ assert x[-2] == 0.0
57
58
+ size: i32 = 2
59
+ for i in range(100):
60
+ x.append((i * size)/2)
61
+ size = len(x)
62
63
+ for i in range(size):
64
+ assert x[i] == x[((i-len(x)) + size) % size]
65
66
def tests():
67
test_list_01()
68
test_list_02()
69
+ test_list_03()
70
71
tests()
0 commit comments