From b64f82dff7ce4049684af5ac51e0e2cfe98dc31d Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Fri, 11 Oct 2019 15:24:40 -0500 Subject: [PATCH] Add failing test --- src/test/contracts/set_arithmetic.ligo | 3 +++ src/test/integration_tests.ml | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/src/test/contracts/set_arithmetic.ligo b/src/test/contracts/set_arithmetic.ligo index 1a8e3550f..f38c1319f 100644 --- a/src/test/contracts/set_arithmetic.ligo +++ b/src/test/contracts/set_arithmetic.ligo @@ -20,6 +20,9 @@ function remove_syntax (var s : set(string)) : set(string) is function patch_op (var s: set(string)) : set(string) is begin patch s with set ["foobar"]; end with s +function patch_op_deep (var s: set(string)*nat) : set(string)*nat is + begin patch s.0 with set ["foobar"]; end with s + function patch_op_empty (var s: set(string)) : set(string) is begin patch s with set []; end with s diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index 9d2405ead..4ef61ad01 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -249,6 +249,14 @@ let set_arithmetic () : unit result = expect_eq program "patch_op" (e_set [e_string "foo" ; e_string "bar"]) (e_set [e_string "foo" ; e_string "bar"; e_string "foobar"]) in + let%bind () = + expect_eq program "patch_op_deep" + (e_pair + (e_set [e_string "foo" ; e_string "bar"]) + (e_nat 42)) + (e_pair + (e_set [e_string "foo" ; e_string "bar" ; e_string "foobar"]) + (e_nat 42)) in let%bind () = expect_eq program "patch_op_empty" (e_set [e_string "foo" ; e_string "bar"])