Skip to content

Commit a95716c

Browse files
Added Reference test (Issue #1926)
1 parent 942cffe commit a95716c

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from lpython import i32
2+
3+
def variable_function():
4+
x: int = 1
5+
y: i32 = 2
6+
print("x + y is", x + y)
7+
8+
variable_function()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"basename": "asr-test_int_semantic_error-44fe25e",
3+
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
4+
"infile": "tests/errors/test_int_semantic_error.py",
5+
"infile_hash": "79ca7d3f440b2538aa0819f910bea5ef24820d245b2179e1bf4cce6d",
6+
"outfile": null,
7+
"outfile_hash": null,
8+
"stdout": null,
9+
"stdout_hash": null,
10+
"stderr": "asr-test_int_semantic_error-44fe25e.stderr",
11+
"stderr_hash": "a1cd1ec0fee194e3c1651668753a1666ca46c925fa91335c6230e026",
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: int type is not supported yet.
2+
--> tests/errors/test_int_semantic_error.py:4:8
3+
|
4+
4 | x: int = 1
5+
| ^^^ Hint: Use i8, i16, i32 or i64 for now.

tests/tests.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,10 @@ asr = true
11001100
filename = "errors/test_unsupported_type.py"
11011101
asr = true
11021102

1103+
[[test]]
1104+
filename = "errors/test_int_semantic_error.py"
1105+
asr = true
1106+
11031107
[[test]]
11041108
filename = "errors/generics_error_01.py"
11051109
asr = true

0 commit comments

Comments
 (0)