Skip to content

Commit 304107f

Browse files
committed
TEST: Add test for pass inside struct
1 parent a1b378a commit 304107f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

integration_tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,7 @@ RUN(NAME structs_24 LABELS cpython llvm c)
578578
RUN(NAME structs_25 LABELS cpython llvm c)
579579
RUN(NAME structs_26 LABELS cpython llvm c)
580580
RUN(NAME structs_27 LABELS cpython llvm c)
581+
RUN(NAME structs_28 LABELS cpython llvm c)
581582

582583
RUN(NAME symbolics_01 LABELS cpython_sym c_sym)
583584
RUN(NAME symbolics_02 LABELS cpython_sym c_sym)

integration_tests/structs_28.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from lpython import dataclass, i32
2+
3+
@dataclass
4+
class Pattern:
5+
_foo : str
6+
pass
7+
_n: i32
8+
9+
def main0():
10+
p: Pattern = Pattern("some string", 5)
11+
assert p._foo == "some string"
12+
assert p._n == 5
13+
print(p)
14+
15+
main0()

0 commit comments

Comments
 (0)