Skip to content

Commit 322f9c3

Browse files
Add a test and register in CMakeLists
1 parent 14236f5 commit 322f9c3

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

integration_tests/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,4 +430,5 @@ RUN(NAME bit_operations_i32 LABELS cpython llvm wasm wasm_x64)
430430
RUN(NAME bit_operations_i64 LABELS cpython llvm wasm)
431431

432432
RUN(NAME test_argv_01 LABELS llvm) # TODO: Test using CPython
433-
RUN(NAME global_syms_01 LABELS cpython)
433+
RUN(NAME global_syms_01 LABELS cpython llvm)
434+
RUN(NAME global_syms_02 LABELS cpython llvm)

integration_tests/global_syms_02.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from ltypes import i32
2+
3+
x: list[i32]
4+
x = [0, 1]
5+
x.append(3)
6+
7+
def test_global_symbols():
8+
assert len(x) == 3
9+
x.insert(2, 2)
10+
11+
test_global_symbols()
12+
13+
i: i32
14+
for i in range(len(x)):
15+
assert i == x[i]
16+
17+
tmp: list[i32]
18+
tmp = x
19+
20+
tmp.remove(0)
21+
assert len(tmp) == 3
22+
tmp.clear()
23+
assert len(tmp) == 0

0 commit comments

Comments
 (0)