Skip to content

Commit

Permalink
add and update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kabra1110 authored and czgdp1807 committed Aug 7, 2023
1 parent 3807faf commit a7cdc18
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ RUN(NAME test_dict_13 LABELS cpython llvm c)
RUN(NAME test_dict_bool LABELS cpython llvm)
RUN(NAME test_dict_increment LABELS cpython llvm)
RUN(NAME test_dict_keys_values LABELS cpython llvm)
RUN(NAME test_dict_nested1 LABELS cpython llvm)
RUN(NAME test_set_len LABELS cpython llvm)
RUN(NAME test_set_add LABELS cpython llvm)
RUN(NAME test_set_remove LABELS cpython llvm)
Expand Down
9 changes: 9 additions & 0 deletions integration_tests/test_dict_nested1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from lpython import i32

def test_nested_dict():
d: dict[i32, dict[i32, i32]] = {1001: {2002: 3003}, 1002: {101: 2}}
d[1001] = d[1002]
d[1001][100] = 4005
assert d[1001][100] == 4005

test_nested_dict()
2 changes: 1 addition & 1 deletion tests/reference/asr-test_assign6-05cd64f.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"stdout": null,
"stdout_hash": null,
"stderr": "asr-test_assign6-05cd64f.stderr",
"stderr_hash": "294865737572b9ab043b8ebab73fe949fa2bb73e9790c6a04d87dc50",
"stderr_hash": "5bc5e0f7454a31bb924cf1318c59e73da2446502181b92faffd9f5d4",
"returncode": 2
}
2 changes: 1 addition & 1 deletion tests/reference/asr-test_assign6-05cd64f.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ semantic error: 'str' object does not support item assignment
--> tests/errors/test_assign6.py:4:5
|
4 | s[0] = 'f'
| ^^^^^^^^^^
| ^^^^
2 changes: 1 addition & 1 deletion tests/reference/asr-test_assign7-beebac3.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"stdout": null,
"stdout_hash": null,
"stderr": "asr-test_assign7-beebac3.stderr",
"stderr_hash": "d12f04efad566740bd562fbe9c00a058210a9adf0f5297475fc41fe6",
"stderr_hash": "109f7da7ac86c0c2add0ff034655336396cb58ebe81570c1d0ce6e81",
"returncode": 2
}
2 changes: 1 addition & 1 deletion tests/reference/asr-test_assign7-beebac3.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ semantic error: 'tuple[i32, i32]' object does not support item assignment
--> tests/errors/test_assign7.py:4:5
|
4 | t[0] = 3
| ^^^^^^^^
| ^^^^

0 comments on commit a7cdc18

Please sign in to comment.