From 76e3bfa2d162a811f040c5a60186ee8139bed14f Mon Sep 17 00:00:00 2001 From: arteevraina Date: Wed, 29 Nov 2023 11:43:28 +0530 Subject: [PATCH] tests: added test for imported classes usage --- integration_tests/CMakeLists.txt | 3 +++ integration_tests/transaction_01.py | 10 ++++++++++ integration_tests/transaction_02.py | 4 ++++ 3 files changed, 17 insertions(+) create mode 100644 integration_tests/transaction_01.py create mode 100644 integration_tests/transaction_02.py diff --git a/integration_tests/CMakeLists.txt b/integration_tests/CMakeLists.txt index 3540040ea6f..95694d3fe88 100644 --- a/integration_tests/CMakeLists.txt +++ b/integration_tests/CMakeLists.txt @@ -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) diff --git a/integration_tests/transaction_01.py b/integration_tests/transaction_01.py new file mode 100644 index 00000000000..1f6ee9a26fc --- /dev/null +++ b/integration_tests/transaction_01.py @@ -0,0 +1,10 @@ +from lpython import dataclass + +@dataclass +class Transaction: + date: str + name: str + +@dataclass +class Transactions: + transactions: list[Transaction] \ No newline at end of file diff --git a/integration_tests/transaction_02.py b/integration_tests/transaction_02.py new file mode 100644 index 00000000000..19dc82aba91 --- /dev/null +++ b/integration_tests/transaction_02.py @@ -0,0 +1,4 @@ +from transaction_01 import Transactions, Transaction + +transactions: list[Transaction] = [] +asr: Transactions = Transactions(transactions=transactions) \ No newline at end of file