Skip to content

Commit

Permalink
Add error and reference files
Browse files Browse the repository at this point in the history
  • Loading branch information
faze-geek committed Jun 17, 2022
1 parent ed556b4 commit 5002fbf
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/errors/test_str_slicing2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def f():
s: str
s = "abcd"
print(s[1.5:3])

f()
6 changes: 6 additions & 0 deletions tests/errors/test_str_slicing3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def f():
s: str
s = "abcd"
print(s[1:3:0.5])

f()
13 changes: 13 additions & 0 deletions tests/reference/asr-test_str_slicing2-2f07e9a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"basename": "asr-test_str_slicing2-2f07e9a",
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
"infile": "tests/errors/test_str_slicing2.py",
"infile_hash": "eb9027d2b6ec0aba9cc78aeedc1b0b36972ff36b076fecf547eeb014",
"outfile": null,
"outfile_hash": null,
"stdout": null,
"stdout_hash": null,
"stderr": "asr-test_str_slicing2-2f07e9a.stderr",
"stderr_hash": "48a9286126c2333bdf5237358bd4ad27acac4a16a78069c9bd36d089",
"returncode": 2
}
5 changes: 5 additions & 0 deletions tests/reference/asr-test_str_slicing2-2f07e9a.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
semantic error: slice indices must be integers or None
--> tests/errors/test_str_slicing2.py:4:13
|
4 | print(s[1.5:3])
| ^^^
13 changes: 13 additions & 0 deletions tests/reference/asr-test_str_slicing3-fe6a03c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"basename": "asr-test_str_slicing3-fe6a03c",
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
"infile": "tests/errors/test_str_slicing3.py",
"infile_hash": "b223abc3ec96fe91876fa188259f151d61383687776e8975df45b139",
"outfile": null,
"outfile_hash": null,
"stdout": null,
"stdout_hash": null,
"stderr": "asr-test_str_slicing3-fe6a03c.stderr",
"stderr_hash": "5f7553d1509bed25d5137abc4fc2cb1d2cb983a1fab81d8d178ed197",
"returncode": 2
}
5 changes: 5 additions & 0 deletions tests/reference/asr-test_str_slicing3-fe6a03c.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
semantic error: slice indices must be integers or None
--> tests/errors/test_str_slicing3.py:4:17
|
4 | print(s[1:3:0.5])
| ^^^
8 changes: 8 additions & 0 deletions tests/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,14 @@ asr = true
filename = "errors/test_str_slicing.py"
asr = true

[[test]]
filename = "errors/test_str_slicing2.py"
asr = true

[[test]]
filename = "errors/test_str_slicing3.py"
asr = true

[[test]]
filename = "errors/test_annassign_type_mismatch.py"
asr = true
Expand Down

0 comments on commit 5002fbf

Please sign in to comment.