diff --git a/src/test/contracts/set_arithmetic-1.mligo b/src/test/contracts/set_arithmetic-1.mligo new file mode 100644 index 000000000..811b5b7af --- /dev/null +++ b/src/test/contracts/set_arithmetic-1.mligo @@ -0,0 +1,6 @@ +// Test set iteration + +let aggregate (i : int) (j : int) : int = i + j + +let fold_op (s : int set) : int = + Set.fold s 15 aggregate diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index 7c5b18938..b0796453b 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -330,6 +330,7 @@ let set_arithmetic () : unit result = let set_arithmetic_mligo () : unit result = let%bind program = mtype_file "./contracts/set_arithmetic.mligo" in + let%bind program_1 = type_file "./contracts/set_arithmetic-1.ligo" in let%bind () = expect_eq program "size_op" (e_set [e_string "foo"; e_string "bar"; e_string "foobar"]) @@ -350,6 +351,11 @@ let set_arithmetic_mligo () : unit result = expect_eq program "remove_op" (e_set [e_string "foo" ; e_string "bar" ; e_string "foobar"]) (e_set [e_string "foo" ; e_string "bar"]) in + let%bind () = + expect_eq program_1 "fold_op" + (e_set [ e_int 4 ; e_int 10 ]) + (e_int 29) + in ok () let unit_expression () : unit result =