Skip to content

Commit

Permalink
tests: added test for imported classes usage
Browse files Browse the repository at this point in the history
  • Loading branch information
arteevraina committed Nov 29, 2023
1 parent ccad3ff commit 6ef9500
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,9 @@ RUN(NAME callback_03 LABELS cpython llvm c)

RUN(NAME lambda_01 LABELS cpython llvm)

RUN(NAME transaction_01 LABELS cpython llvm c)
RUN(NAME transaction_02 LABELS cpython llvm c)

# callback_04 is to test emulation. So just run with cpython
RUN(NAME callback_04 IMPORT_PATH .. LABELS cpython)

Expand Down
10 changes: 10 additions & 0 deletions integration_tests/transaction_01.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from lpython import dataclass

@dataclass
class Transaction:
date: str
name: str

@dataclass
class Transactions:
transactions: list[Transaction]
4 changes: 4 additions & 0 deletions integration_tests/transaction_02.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from transaction_01 import Transactions, Transaction

transactions: list[Transaction] = []
asr: Transactions = Transactions(transactions=transactions)

0 comments on commit 6ef9500

Please sign in to comment.