From 7eed9b1856e6c0c9a6c46a45eaa17f051bc4367c Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Sun, 27 Oct 2019 11:47:17 +0100 Subject: [PATCH] test passing ! --- src/test/contracts/loop.ligo | 6 +++--- src/test/integration_tests.ml | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/test/contracts/loop.ligo b/src/test/contracts/loop.ligo index 647735953..d96753105 100644 --- a/src/test/contracts/loop.ligo +++ b/src/test/contracts/loop.ligo @@ -31,7 +31,7 @@ function lamby (var accu : (record st : string ; acc : int end) ; var i : int ) accu.st := accu.st ^ "to" ; } with accu -function for_collection (var nee : unit; var nuu : unit) : (int * string) is block { +function for_collection_ (var nee : unit; var nuu : unit) : (int * string) is block { var acc : int := 0 ; var st : string := "to" ; var mylist : list(int) := list 1 ; 1 ; 1 end ; @@ -46,7 +46,7 @@ function for_collection (var nee : unit; var nuu : unit) : (int * string) is blo } with (folded_record.acc , folded_record.st) -function for_collection_ (var nee : unit; var nuu : unit) : (int * string) is block { +function for_collection (var nee : unit) : (int * string) is block { var acc : int := 0 ; var st : string := "to" ; // var toto : (string * string) := ("foo","bar") ; @@ -60,7 +60,7 @@ function for_collection_ (var nee : unit; var nuu : unit) : (int * string) is bl st := st^"to" ; end -} with acc +} with (acc, st) function dummy (const n : nat) : nat is block { while (False) block { skip } diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index 0088b0e31..992c21d4a 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -670,6 +670,11 @@ let loop () : unit result = let make_expected = fun n -> e_int (n * (n + 1) / 2) in expect_eq_n_pos_mid program "for_sum" make_input make_expected in + let%bind () = + let input = e_unit () in + let expected = e_pair (e_int 3) (e_string "totototo") in + expect_eq program "for_collection" input expected + in ok () (* Don't know how to assert parse error happens in this test framework