Add tests

This commit is contained in:
Gaith Hallak 2022-11-18 17:11:12 +03:00
parent 3b7f083817
commit 6499823e5f
3 changed files with 19 additions and 0 deletions

View File

@ -1175,6 +1175,13 @@ failing_contracts() ->
[<<?Pos(5,16) [<<?Pos(5,16)
"`f` must be payable because the entrypoint `f` in the interface `I` is payable">> "`f` must be payable because the entrypoint `f` in the interface `I` is payable">>
]) ])
, ?TYPE_ERROR(calling_child_contract_entrypoint,
[<<?Pos(5,20)
"Invalid call to contract entrypoint `F.g`.\n"
"It must be called as `c.g` for some `c : F`.">>])
, ?TYPE_ERROR(using_contract_as_namespace,
[<<?Pos(5,3)
"Cannot use undefined namespace F">>])
]. ].
validation_test_() -> validation_test_() ->

View File

@ -0,0 +1,5 @@
contract F =
entrypoint g() = 1
main contract C =
entrypoint f() = F.g()

View File

@ -0,0 +1,7 @@
contract F =
entrypoint g() = 1
main contract C =
using F for [g]
entrypoint f() = g()