From 42b05c0437ae0d86dc2f6534e42f7634b6c855de Mon Sep 17 00:00:00 2001 From: Sander Spies Date: Mon, 13 Apr 2020 10:31:09 +0200 Subject: [PATCH] Test tuples without annotations. --- src/bin/expect_tests/contract_tests.ml | 15 ++++++++++++++- src/test/contracts/tuples_no_annotation.religo | 7 +++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/test/contracts/tuples_no_annotation.religo diff --git a/src/bin/expect_tests/contract_tests.ml b/src/bin/expect_tests/contract_tests.ml index f16a38e0b..05f5cef7a 100644 --- a/src/bin/expect_tests/contract_tests.ml +++ b/src/bin/expect_tests/contract_tests.ml @@ -1173,7 +1173,20 @@ ligo: in file "create_contract_var.mligo", line 6, character 35 to line 10, char CONS ; DIP { DIP { DUP } ; SWAP ; CDR } ; PAIR ; - DIP { DROP 2 } } } |}] + DIP { DROP 2 } } } |}]; + + run_ligo_good [ "compile-contract" ; contract "tuples_no_annotation.religo" ; "main" ] ; + [%expect {| + { parameter int ; + storage (pair (pair int string) (pair nat bool)) ; + code { PUSH string "2" ; + PUSH int 2 ; + PAIR ; + DIP { PUSH bool False ; PUSH nat 2 ; PAIR } ; + PAIR ; + NIL operation ; + PAIR ; + DIP { DROP } } } |}] let%expect_test _ = run_ligo_bad [ "compile-contract" ; bad_contract "self_type_annotation.ligo" ; "main" ] ; diff --git a/src/test/contracts/tuples_no_annotation.religo b/src/test/contracts/tuples_no_annotation.religo new file mode 100644 index 000000000..6858c60a5 --- /dev/null +++ b/src/test/contracts/tuples_no_annotation.religo @@ -0,0 +1,7 @@ +type storage = (int, string, nat, bool) + +type parameter = int + +let main = ((p,storage): (parameter, storage)) => { +([]: list (operation), (2, "2", 2n, false)); +};