Skip to content

Commit bf4c38f

Browse files
committed
Register the errors
1 parent 809bec2 commit bf4c38f

7 files changed

+56
-0
lines changed

tests/errors/test_assign6.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def f():
2+
s: str
3+
s = "abcde"
4+
s[0] = 'f'
5+
6+
f()

tests/errors/test_assign7.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def f():
2+
t: tuple[i32, i32]
3+
t = (1, 2)
4+
t[0] = 3
5+
6+
f()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"basename": "asr-test_assign6-05cd64f",
3+
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
4+
"infile": "tests/errors/test_assign6.py",
5+
"infile_hash": "6837d07201b8680dbb63908d3ad27e4e9bfb1f1ff77b4bd6a77eddcf",
6+
"outfile": null,
7+
"outfile_hash": null,
8+
"stdout": null,
9+
"stdout_hash": null,
10+
"stderr": "asr-test_assign6-05cd64f.stderr",
11+
"stderr_hash": "294865737572b9ab043b8ebab73fe949fa2bb73e9790c6a04d87dc50",
12+
"returncode": 2
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
semantic error: 'str' object does not support item assignment
2+
--> tests/errors/test_assign6.py:4:5
3+
|
4+
4 | s[0] = 'f'
5+
| ^^^^^^^^^^
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"basename": "asr-test_assign7-beebac3",
3+
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
4+
"infile": "tests/errors/test_assign7.py",
5+
"infile_hash": "e54f67638add63131760d5eadda7e3944b34addacffa27d6fb45e128",
6+
"outfile": null,
7+
"outfile_hash": null,
8+
"stdout": null,
9+
"stdout_hash": null,
10+
"stderr": "asr-test_assign7-beebac3.stderr",
11+
"stderr_hash": "3beb690fa0cb1a8fc1e8e2618df70fdeb89d888d7b3aeb40fca2b24a",
12+
"returncode": 2
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
semantic error: 'tuple' object does not support item assignment
2+
--> tests/errors/test_assign7.py:4:5
3+
|
4+
4 | t[0] = 3
5+
| ^^^^^^^^

tests/tests.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,14 @@ asr = true
630630
filename = "errors/test_assign5.py"
631631
asr = true
632632

633+
[[test]]
634+
filename = "errors/test_assign6.py"
635+
asr = true
636+
637+
[[test]]
638+
filename = "errors/test_assign7.py"
639+
asr = true
640+
633641
[[test]]
634642
filename = "errors/test_binop1.py"
635643
asr = true

0 commit comments

Comments
 (0)