From 6499823e5fd18fa4e533e1ec52685ecced0127a8 Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Fri, 18 Nov 2022 17:11:12 +0300 Subject: [PATCH] Add tests --- test/aeso_compiler_tests.erl | 7 +++++++ test/contracts/calling_child_contract_entrypoint.aes | 5 +++++ test/contracts/using_contract_as_namespace.aes | 7 +++++++ 3 files changed, 19 insertions(+) create mode 100644 test/contracts/calling_child_contract_entrypoint.aes create mode 100644 test/contracts/using_contract_as_namespace.aes diff --git a/test/aeso_compiler_tests.erl b/test/aeso_compiler_tests.erl index 81f2cef..1c724a5 100644 --- a/test/aeso_compiler_tests.erl +++ b/test/aeso_compiler_tests.erl @@ -1175,6 +1175,13 @@ failing_contracts() -> [<> ]) + , ?TYPE_ERROR(calling_child_contract_entrypoint, + [<>]) + , ?TYPE_ERROR(using_contract_as_namespace, + [<>]) ]. validation_test_() -> diff --git a/test/contracts/calling_child_contract_entrypoint.aes b/test/contracts/calling_child_contract_entrypoint.aes new file mode 100644 index 0000000..3e9f4c0 --- /dev/null +++ b/test/contracts/calling_child_contract_entrypoint.aes @@ -0,0 +1,5 @@ +contract F = + entrypoint g() = 1 + +main contract C = + entrypoint f() = F.g() diff --git a/test/contracts/using_contract_as_namespace.aes b/test/contracts/using_contract_as_namespace.aes new file mode 100644 index 0000000..61c1390 --- /dev/null +++ b/test/contracts/using_contract_as_namespace.aes @@ -0,0 +1,7 @@ +contract F = + entrypoint g() = 1 + +main contract C = + using F for [g] + + entrypoint f() = g() \ No newline at end of file