Skip to content

Commit

Permalink
Add test and update references
Browse files Browse the repository at this point in the history
  • Loading branch information
Smit-create committed Jun 28, 2023
1 parent 77e04fa commit 284958f
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/errors/structs_11.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from lpython import dataclass, i32

# test issue 2044

@dataclass
class Foo:
x : i32

@dataclass
class Bar:
foo : Foo = Foo()

bar : Bar = Bar()

print(bar.foo)
print(bar)
13 changes: 13 additions & 0 deletions tests/reference/llvm-structs_11-a746e1b.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"basename": "llvm-structs_11-a746e1b",
"cmd": "lpython --no-color --show-llvm {infile} -o {outfile}",
"infile": "tests/errors/structs_11.py",
"infile_hash": "9cb6c80ad837ba66472a91b22e9068ec439b6a2a179a452d90d84c78",
"outfile": null,
"outfile_hash": null,
"stdout": null,
"stdout_hash": null,
"stderr": "llvm-structs_11-a746e1b.stderr",
"stderr_hash": "58e383d2ac915263088426f1b511760a8cb9ef3dd6f24cb207eda4de",
"returncode": 3
}
5 changes: 5 additions & 0 deletions tests/reference/llvm-structs_11-a746e1b.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
code generation error: Printing support is not available for `Foo` type.
--> tests/errors/structs_11.py:16:1
|
16 | print(bar)
| ^^^^^^^^^^
4 changes: 4 additions & 0 deletions tests/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,10 @@ asr = true
filename = "errors/structs_10.py"
asr = true

[[test]]
filename = "errors/structs_11.py"
llvm = true

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

0 comments on commit 284958f

Please sign in to comment.