Skip to content

Commit 6d56882

Browse files
authored
Merge pull request #2623 from aryangupta701/error-ref
add test reference for an error message
2 parents 4dbbf93 + 388acb5 commit 6d56882

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

tests/errors/test_optional.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def match(pat : str, string : str) -> Optional[list[str] | str]:
2+
return None
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"basename": "asr-test_optional-97e5371",
3+
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
4+
"infile": "tests/errors/test_optional.py",
5+
"infile_hash": "2532c73de47afb82c9d1d9fa335d3b274e7c79a14007353639958a45",
6+
"outfile": null,
7+
"outfile_hash": null,
8+
"stdout": null,
9+
"stdout_hash": null,
10+
"stderr": "asr-test_optional-97e5371.stderr",
11+
"stderr_hash": "b9cc75eb200847db5d4d39d9f511959ebf22faad68cf0096c7a2b68c",
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: The type 'Optional' is undeclared.
2+
--> tests/errors/test_optional.py:1:39
3+
|
4+
1 | def match(pat : str, string : str) -> Optional[list[str] | str]:
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^

tests/tests.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,3 +1383,7 @@ run_with_dbg = true
13831383
[[test]]
13841384
filename = "runtime_errors/test_raise_01.py"
13851385
run_with_dbg = true
1386+
1387+
[[test]]
1388+
filename = "errors/test_optional.py"
1389+
asr = true

0 commit comments

Comments
 (0)