Skip to content

Commit

Permalink
Added Reference test (Issue lcompilers#1926)
Browse files Browse the repository at this point in the history
  • Loading branch information
NishantBansal2003 committed Feb 5, 2024
1 parent 942cffe commit a95716c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/errors/test_int_semantic_error.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from lpython import i32

def variable_function():
x: int = 1
y: i32 = 2
print("x + y is", x + y)

variable_function()
13 changes: 13 additions & 0 deletions tests/reference/asr-test_int_semantic_error-44fe25e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"basename": "asr-test_int_semantic_error-44fe25e",
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
"infile": "tests/errors/test_int_semantic_error.py",
"infile_hash": "79ca7d3f440b2538aa0819f910bea5ef24820d245b2179e1bf4cce6d",
"outfile": null,
"outfile_hash": null,
"stdout": null,
"stdout_hash": null,
"stderr": "asr-test_int_semantic_error-44fe25e.stderr",
"stderr_hash": "a1cd1ec0fee194e3c1651668753a1666ca46c925fa91335c6230e026",
"returncode": 2
}
5 changes: 5 additions & 0 deletions tests/reference/asr-test_int_semantic_error-44fe25e.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
semantic error: int type is not supported yet.
--> tests/errors/test_int_semantic_error.py:4:8
|
4 | x: int = 1
| ^^^ Hint: Use i8, i16, i32 or i64 for now.
4 changes: 4 additions & 0 deletions tests/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,10 @@ asr = true
filename = "errors/test_unsupported_type.py"
asr = true

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

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

0 comments on commit a95716c

Please sign in to comment.