diff --git a/src/contracts/loop.ligo b/src/contracts/loop.ligo index 13c47983c..03cc751a7 100644 --- a/src/contracts/loop.ligo +++ b/src/contracts/loop.ligo @@ -16,12 +16,12 @@ function while_sum (var n : nat) : nat is block { } } with r -function for_sum (var n : nat) : nat is block { +(* function for_sum (var n : nat) : nat is block { for i := 1 to 100 begin n := n + 1; end } - with n + with n *) function dummy (const n : nat) : nat is block { while (False) block { skip } diff --git a/src/contracts/procedure.ligo b/src/contracts/procedure.ligo index fe63d191b..a0f6664c6 100644 --- a/src/contracts/procedure.ligo +++ b/src/contracts/procedure.ligo @@ -1,6 +1,11 @@ // Test a trivial PascaLIGO procedure -procedure main (const i : int) : int is +procedure sub (const j: int) is begin - skip - end with i + i := i + 1 + end + +function main (const i: int) : int is + begin + sub(i) + end with i diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index 2382b8719..79b62a0c3 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -16,10 +16,11 @@ let function_ () : unit result = let make_expect = fun n -> n in expect_eq_n_int program "main" make_expect -let procedure () : unit result = +(* Procedures are not supported yet + let procedure () : unit result = let%bind program = type_file "./contracts/procedure.ligo" in - let make_expect = fun n -> n in - expect_eq_n_int program "main" make_expect + let make_expect = fun n -> n + 1 in + expect_eq_n_int program "main" make_expect *) let assign () : unit result = let%bind program = type_file "./contracts/assign.ligo" in @@ -683,7 +684,7 @@ let website2_ligo () : unit result = let main = test_suite "Integration (End to End)" [ test "type alias" type_alias ; test "function" function_ ; - test "procedure" procedure ; + (* test "procedure" procedure ; *) test "assign" assign ; test "declaration local" declaration_local ; test "complex function" complex_function ;