add test
This commit is contained in:
parent
c46210b656
commit
3cb72f8ec2
@ -972,6 +972,10 @@ let%expect_test _ =
|
|||||||
PAIR ;
|
PAIR ;
|
||||||
DIP { DROP } } } |}]
|
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 _ =
|
let%expect_test _ =
|
||||||
run_ligo_bad [ "compile-contract" ; contract "bad_type_operator.ligo" ; "main" ] ;
|
run_ligo_bad [ "compile-contract" ; contract "bad_type_operator.ligo" ; "main" ] ;
|
||||||
[%expect {|
|
[%expect {|
|
||||||
|
8
src/test/contracts/sequence.mligo
Normal file
8
src/test/contracts/sequence.mligo
Normal 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
|
@ -1192,6 +1192,10 @@ let condition_religo () : unit result =
|
|||||||
] in
|
] in
|
||||||
ok ()
|
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 eq_bool_common program =
|
||||||
let%bind _ =
|
let%bind _ =
|
||||||
bind_map_list (fun ( a , b , expected ) ->
|
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 (ligo)" condition ;
|
||||||
test "condition (mligo)" condition_mligo ;
|
test "condition (mligo)" condition_mligo ;
|
||||||
test "condition (religo)" condition_religo ;
|
test "condition (religo)" condition_religo ;
|
||||||
|
test "sequence (mligo" sequence_mligo ;
|
||||||
test "eq bool (ligo)" eq_bool ;
|
test "eq bool (ligo)" eq_bool ;
|
||||||
test "eq bool (mligo)" eq_bool_mligo ;
|
test "eq bool (mligo)" eq_bool_mligo ;
|
||||||
test "eq bool (religo)" eq_bool_religo ;
|
test "eq bool (religo)" eq_bool_religo ;
|
||||||
|
Loading…
Reference in New Issue
Block a user