Add tests

This commit is contained in:
Gaith Hallak 2022-02-28 14:39:37 +04:00
parent b493852464
commit 70bf1c6201
2 changed files with 19 additions and 0 deletions

View File

@ -218,6 +218,7 @@ compilable_contracts() ->
"using_namespace", "using_namespace",
"assign_patterns", "assign_patterns",
"patterns_guards", "patterns_guards",
"pipe_operator",
"test" % Custom general-purpose test file. Keep it last on the list. "test" % Custom general-purpose test file. Keep it last on the list.
]. ].

View File

@ -0,0 +1,18 @@
contract Main =
function is_negative(x : int) =
if (x < 0)
true
else
false
function inc_by_one(x : int) = x + 1
function inc_by_two(x : int) = x + 2
type state = bool
entrypoint init(x : int) = x
|> inc_by_one
|> inc_by_one
|> inc_by_two
|> ((x) => x * 5)
|> is_negative