Skip to content

Commit

Permalink
Added test
Browse files Browse the repository at this point in the history
  • Loading branch information
tanay-man committed Jul 23, 2024
1 parent c0dd732 commit c1bb6d5
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/errors/class_04.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from lpython import i32

class coord:
def __init__(self:"coord", x:i32, y:i32):
self.x: i32 = x
self.y: i32 = y

p1: coord = coord(1, 2)
p2: coord = p1
p2.x = 2
print(p1.x)
print(p2.x)
13 changes: 13 additions & 0 deletions tests/reference/asr-class_04-b89178d.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"basename": "asr-class_04-b89178d",
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
"infile": "tests/errors/class_04.py",
"infile_hash": "e1e1c48050cce1b2855e4f8409aa3d72df716f61b8aa045aa97ae914",
"outfile": null,
"outfile_hash": null,
"stdout": null,
"stdout_hash": null,
"stderr": "asr-class_04-b89178d.stderr",
"stderr_hash": "c31549707a144ce0bf59d5c77c59b86770648b8f0783d9c74470ec49",
"returncode": 2
}
5 changes: 5 additions & 0 deletions tests/reference/asr-class_04-b89178d.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
semantic error: References are not implemented
--> tests/errors/class_04.py:9:1
|
9 | p2: coord = p1
| ^^^^^^^^^^^^^^
4 changes: 4 additions & 0 deletions tests/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,10 @@ asr = true
pass = "class_constructor"
cumulative = true

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

[[test]]
filename = "../integration_tests/callback_01.py"
asr = true
Expand Down

0 comments on commit c1bb6d5

Please sign in to comment.