Skip to content

Commit f403c41

Browse files
committed
Enable and update tests
1 parent 2aba0a8 commit f403c41

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

integration_tests/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,12 @@ RUN(NAME test_dict_01 LABELS cpython llvm c)
383383
RUN(NAME test_dict_02 LABELS cpython llvm c)
384384
RUN(NAME test_dict_03 LABELS cpython llvm)
385385
RUN(NAME test_dict_04 LABELS cpython llvm)
386-
RUN(NAME test_dict_05 LABELS cpython llvm)
386+
RUN(NAME test_dict_05 LABELS cpython llvm c)
387387
RUN(NAME test_dict_06 LABELS cpython llvm c)
388-
RUN(NAME test_dict_07 LABELS cpython llvm)
388+
RUN(NAME test_dict_07 LABELS cpython llvm c)
389389
RUN(NAME test_dict_08 LABELS cpython llvm c)
390390
RUN(NAME test_dict_09 LABELS cpython llvm c)
391-
RUN(NAME test_dict_10 LABELS cpython llvm) # TODO: Add support of dict with string in C backend
391+
RUN(NAME test_dict_10 LABELS cpython llvm c)
392392
RUN(NAME test_dict_11 LABELS cpython llvm c)
393393
RUN(NAME test_dict_bool LABELS cpython llvm)
394394
RUN(NAME test_for_loop LABELS cpython llvm c)

integration_tests/test_dict_07.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1+
from lpython import i32
2+
3+
14
def fill_smalltocapital() -> dict[str, str]:
2-
return {'a': 'A', 'b': 'B', 'c': 'C', 'd': 'D','e': 'E',
3-
'f': 'F', 'g': 'G', 'h': 'H', 'i': 'I','j': 'J',
4-
'k': 'K', 'l': 'L', 'm': 'M', 'n': 'N','o': 'O',
5-
'p': 'P', 'q': 'Q', 'r': 'R', 's': 'S','t': 'T',
6-
'u': 'U', 'v': 'V', 'w': 'W', 'x': 'X','y': 'Y',
5+
return {'a': 'A', 'b': 'B', 'c': 'C', 'd': 'D','e': 'E',
6+
'f': 'F', 'g': 'G', 'h': 'H', 'i': 'I','j': 'J',
7+
'k': 'K', 'l': 'L', 'm': 'M', 'n': 'N','o': 'O',
8+
'p': 'P', 'q': 'Q', 'r': 'R', 's': 'S','t': 'T',
9+
'u': 'U', 'v': 'V', 'w': 'W', 'x': 'X','y': 'Y',
710
'z': 'Z'}
811

912
def test_dict():
10-
i : i32
13+
i: i32
1114
smalltocaps: dict[str, str]
1215
smalltocaps = fill_smalltocapital()
1316

integration_tests/test_dict_10.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1+
from lpython import i32
2+
13
# test case for passing dict with key-value as strings as argument to function
24

35
def test_assertion(smalltocaps: dict[str, str]):
4-
i : i32
6+
i: i32
57
assert len(smalltocaps) == 26
68
for i in range(97, 97 + 26):
79
assert smalltocaps[chr(i)] == chr(i - 32)
810

911
def test_dict():
1012
smalltocaps: dict[str, str]
11-
smalltocaps = {'a': 'A', 'b': 'B', 'c': 'C', 'd': 'D','e': 'E',
12-
'f': 'F', 'g': 'G', 'h': 'H', 'i': 'I','j': 'J',
13-
'k': 'K', 'l': 'L', 'm': 'M', 'n': 'N','o': 'O',
14-
'p': 'P', 'q': 'Q', 'r': 'R', 's': 'S','t': 'T',
15-
'u': 'U', 'v': 'V', 'w': 'W', 'x': 'X','y': 'Y',
13+
smalltocaps = {'a': 'A', 'b': 'B', 'c': 'C', 'd': 'D','e': 'E',
14+
'f': 'F', 'g': 'G', 'h': 'H', 'i': 'I','j': 'J',
15+
'k': 'K', 'l': 'L', 'm': 'M', 'n': 'N','o': 'O',
16+
'p': 'P', 'q': 'Q', 'r': 'R', 's': 'S','t': 'T',
17+
'u': 'U', 'v': 'V', 'w': 'W', 'x': 'X','y': 'Y',
1618
'z': 'Z'}
1719

1820
test_assertion(smalltocaps)

0 commit comments

Comments
 (0)