diff --git a/src/contracts/lambda.ligo b/src/contracts/lambda.ligo new file mode 100644 index 000000000..cc426e83d --- /dev/null +++ b/src/contracts/lambda.ligo @@ -0,0 +1,6 @@ +function f (const x : unit) : unit is + begin skip end with unit + +function main (const p : unit ; const s : unit) : unit is + var y : unit := f(unit) ; + begin skip end with y diff --git a/src/contracts/parser-bad-reported-term.ligo b/src/contracts/parser-bad-reported-term.ligo new file mode 100644 index 000000000..05dc69e3e --- /dev/null +++ b/src/contracts/parser-bad-reported-term.ligo @@ -0,0 +1,6 @@ +function f (const x : unit) : unit is + begin skip end with unit + +function main (const p : unit ; const s : unit) : unit is + behin skip end with f unit +// the srcloc is correct but the reported term is "skip" instead of "behin". diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index fcaea7093..92e88ed1e 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -508,6 +508,12 @@ let lambda_mligo () : unit result = let make_expected = (e_unit ()) in expect_eq program "main" make_input make_expected +let lambda_ligo () : unit result = + let%bind program = type_file "./contracts/lambda.ligo" in + let make_input = e_pair (e_unit ()) (e_unit ()) in + let make_expected = (e_unit ()) in + expect_eq program "main" make_input make_expected + let lambda2_mligo () : unit result = let%bind program = mtype_file "./contracts/lambda2.mligo" in let make_input = e_pair (e_unit ()) (e_unit ()) in @@ -574,6 +580,7 @@ let main = test_suite "Integration (End to End)" [ (* test "failwith mligo" failwith_mligo ; *) (* test "guess string mligo" guess_string_mligo ; WIP? *) test "lambda mligo" lambda_mligo ; + test "lambda ligo" lambda_ligo ; (* test "lambda2 mligo" lambda2_mligo ; *) test "website1 ligo" website1_ligo ; test "website2 ligo" website2_ligo ;