Add CameLIGO test function utilizing multiple subroutines

This commit is contained in:
John David Pressman 2019-10-24 15:27:26 -07:00
parent 99dfd18dea
commit 0eb2b73afa
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,7 @@
(* Test use of multiple subroutines in a CameLIGO function *)
let foo (i: int) : int = i + 20
let bar (i: int) : int = i + 50
let foobar (i: int) : int = (foo i) + (bar i)

View File

@ -150,6 +150,14 @@ let shared_function () : unit result =
in
ok ()
let shared_function_mligo () : unit result =
let%bind program = mtype_file "./contracts/function-shared.mligo" in
let%bind () =
let make_expect = fun n -> (2 * n + 70) in
expect_eq_n_int program "foobar" make_expect
in
ok ()
let bool_expression () : unit result =
let%bind program = type_file "./contracts/boolean_operators.ligo" in
let%bind _ =
@ -955,6 +963,7 @@ let main = test_suite "Integration (End to End)" [
test "complex function" complex_function ;
test "closure" closure ;
test "shared function" shared_function ;
test "shared function (mligo)" shared_function_mligo ;
test "higher order" higher_order ;
test "variant" variant ;
test "variant (mligo)" variant_mligo ;