added test calling a function with ligo

This commit is contained in:
Georges Dupéron 2019-06-07 01:17:33 +02:00
parent 346a6fdbc4
commit 743098ecbd
3 changed files with 19 additions and 0 deletions

View File

@ -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

View File

@ -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".

View File

@ -500,6 +500,12 @@ let lambda_mligo () : unit result =
let make_expected = (e_unit ()) in let make_expected = (e_unit ()) in
expect_eq program "main" make_input make_expected 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 lambda2_mligo () : unit result =
let%bind program = mtype_file "./contracts/lambda2.mligo" in let%bind program = mtype_file "./contracts/lambda2.mligo" in
let make_input = e_pair (e_unit ()) (e_unit ()) in let make_input = e_pair (e_unit ()) (e_unit ()) in
@ -565,6 +571,7 @@ let main = test_suite "Integration (End to End)" [
(* test "failwith mligo" failwith_mligo ; *) (* test "failwith mligo" failwith_mligo ; *)
(* test "guess string mligo" guess_string_mligo ; WIP? *) (* test "guess string mligo" guess_string_mligo ; WIP? *)
test "lambda mligo" lambda_mligo ; test "lambda mligo" lambda_mligo ;
test "lambda ligo" lambda_ligo ;
(* test "lambda2 mligo" lambda2_mligo ; *) (* test "lambda2 mligo" lambda2_mligo ; *)
test "website1 ligo" website1_ligo ; test "website1 ligo" website1_ligo ;
test "website2 ligo" website2_ligo ; test "website2 ligo" website2_ligo ;