Skip to content

Commit 283cc77

Browse files
committed
TEST: Add error tests for incorrect intents
1 parent b9290d7 commit 283cc77

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

tests/errors/func_02.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from lpython import i32, In
2+
3+
def f(n: In[i32]):
4+
n = 5
5+
print(n)

tests/errors/func_03.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from lpython import i32
2+
3+
def f(l: list[i32]):
4+
l.append(5)

tests/errors/func_04.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from lpython import i32, InOut
2+
3+
def f(n: InOut[i32]):
4+
n = 5
5+
print(n)

tests/tests.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,18 @@ asr = true
10821082
filename = "errors/func_01.py"
10831083
asr = true
10841084

1085+
[[test]]
1086+
filename = "errors/func_02.py"
1087+
asr = true
1088+
1089+
[[test]]
1090+
filename = "errors/func_03.py"
1091+
asr = true
1092+
1093+
[[test]]
1094+
filename = "errors/func_04.py"
1095+
asr = true
1096+
10851097
# tests/runtime_errors
10861098
[[test]]
10871099
filename = "runtime_errors/test_list_01.py"

0 commit comments

Comments
 (0)