Skip to content

Commit 6ef9500

Browse files
committed
tests: added test for imported classes usage
1 parent ccad3ff commit 6ef9500

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

integration_tests/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,9 @@ RUN(NAME callback_03 LABELS cpython llvm c)
798798

799799
RUN(NAME lambda_01 LABELS cpython llvm)
800800

801+
RUN(NAME transaction_01 LABELS cpython llvm c)
802+
RUN(NAME transaction_02 LABELS cpython llvm c)
803+
801804
# callback_04 is to test emulation. So just run with cpython
802805
RUN(NAME callback_04 IMPORT_PATH .. LABELS cpython)
803806

integration_tests/transaction_01.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from lpython import dataclass
2+
3+
@dataclass
4+
class Transaction:
5+
date: str
6+
name: str
7+
8+
@dataclass
9+
class Transactions:
10+
transactions: list[Transaction]

integration_tests/transaction_02.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from transaction_01 import Transactions, Transaction
2+
3+
transactions: list[Transaction] = []
4+
asr: Transactions = Transactions(transactions=transactions)

0 commit comments

Comments
 (0)