Skip to content

Commit 5002fbf

Browse files
committed
Add error and reference files
1 parent ed556b4 commit 5002fbf

7 files changed

+56
-0
lines changed

tests/errors/test_str_slicing2.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 = "abcd"
4+
print(s[1.5:3])
5+
6+
f()

tests/errors/test_str_slicing3.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 = "abcd"
4+
print(s[1:3:0.5])
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_str_slicing2-2f07e9a",
3+
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
4+
"infile": "tests/errors/test_str_slicing2.py",
5+
"infile_hash": "eb9027d2b6ec0aba9cc78aeedc1b0b36972ff36b076fecf547eeb014",
6+
"outfile": null,
7+
"outfile_hash": null,
8+
"stdout": null,
9+
"stdout_hash": null,
10+
"stderr": "asr-test_str_slicing2-2f07e9a.stderr",
11+
"stderr_hash": "48a9286126c2333bdf5237358bd4ad27acac4a16a78069c9bd36d089",
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: slice indices must be integers or None
2+
--> tests/errors/test_str_slicing2.py:4:13
3+
|
4+
4 | print(s[1.5:3])
5+
| ^^^
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"basename": "asr-test_str_slicing3-fe6a03c",
3+
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
4+
"infile": "tests/errors/test_str_slicing3.py",
5+
"infile_hash": "b223abc3ec96fe91876fa188259f151d61383687776e8975df45b139",
6+
"outfile": null,
7+
"outfile_hash": null,
8+
"stdout": null,
9+
"stdout_hash": null,
10+
"stderr": "asr-test_str_slicing3-fe6a03c.stderr",
11+
"stderr_hash": "5f7553d1509bed25d5137abc4fc2cb1d2cb983a1fab81d8d178ed197",
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: slice indices must be integers or None
2+
--> tests/errors/test_str_slicing3.py:4:17
3+
|
4+
4 | print(s[1:3:0.5])
5+
| ^^^

tests/tests.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,14 @@ asr = true
373373
filename = "errors/test_str_slicing.py"
374374
asr = true
375375

376+
[[test]]
377+
filename = "errors/test_str_slicing2.py"
378+
asr = true
379+
380+
[[test]]
381+
filename = "errors/test_str_slicing3.py"
382+
asr = true
383+
376384
[[test]]
377385
filename = "errors/test_annassign_type_mismatch.py"
378386
asr = true

0 commit comments

Comments
 (0)