This commit is contained in:
Pierre-Emmanuel Wulfman 2020-04-09 16:24:55 +02:00
parent c46210b656
commit 3cb72f8ec2
3 changed files with 17 additions and 0 deletions

View File

@ -972,6 +972,10 @@ let%expect_test _ =
PAIR ;
DIP { DROP } } } |}]
let%expect_test _ =
run_ligo_good [ "print-ast-typed" ; contract "sequence.mligo" ; ];
[%expect {| const y = lambda (_) return let x = +1 in let _ = let x = +2 in UNIT() in let _ = let x = +23 in UNIT() in let _ = let x = +42 in UNIT() in x |}]
let%expect_test _ =
run_ligo_bad [ "compile-contract" ; contract "bad_type_operator.ligo" ; "main" ] ;
[%expect {|

View File

@ -0,0 +1,8 @@
let y (_ : unit) : nat =
let x : nat = 1n in
begin
(let x : nat = 2n in unit) ;
(let x : nat = 23n in unit) ;
(let x : nat = 42n in unit) ;
x
end

View File

@ -1192,6 +1192,10 @@ let condition_religo () : unit result =
] in
ok ()
let sequence_mligo () : unit result =
let%bind program = mtype_file "./contracts/sequence.mligo" in
expect_eq program "y" (e_unit ()) (e_nat 1)
let eq_bool_common program =
let%bind _ =
bind_map_list (fun ( a , b , expected ) ->
@ -2390,6 +2394,7 @@ let main = test_suite "Integration (End to End)" [
test "condition (ligo)" condition ;
test "condition (mligo)" condition_mligo ;
test "condition (religo)" condition_religo ;
test "sequence (mligo" sequence_mligo ;
test "eq bool (ligo)" eq_bool ;
test "eq bool (mligo)" eq_bool_mligo ;
test "eq bool (religo)" eq_bool_religo ;