diff --git a/test/aeso_compiler_tests.erl b/test/aeso_compiler_tests.erl index fe3a130..fa3cb6a 100644 --- a/test/aeso_compiler_tests.erl +++ b/test/aeso_compiler_tests.erl @@ -218,6 +218,7 @@ compilable_contracts() -> "using_namespace", "assign_patterns", "patterns_guards", + "pipe_operator", "test" % Custom general-purpose test file. Keep it last on the list. ]. diff --git a/test/contracts/pipe_operator.aes b/test/contracts/pipe_operator.aes new file mode 100644 index 0000000..fc7248f --- /dev/null +++ b/test/contracts/pipe_operator.aes @@ -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