Add failing test

This commit is contained in:
Tom Jack 2019-10-11 15:24:40 -05:00
parent c5361c57d4
commit b64f82dff7
2 changed files with 11 additions and 0 deletions

View File

@ -20,6 +20,9 @@ function remove_syntax (var s : set(string)) : set(string) is
function patch_op (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 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 function patch_op_empty (var s: set(string)) : set(string) is
begin patch s with set []; end with s begin patch s with set []; end with s

View File

@ -249,6 +249,14 @@ let set_arithmetic () : unit result =
expect_eq program "patch_op" expect_eq program "patch_op"
(e_set [e_string "foo" ; e_string "bar"]) (e_set [e_string "foo" ; e_string "bar"])
(e_set [e_string "foo" ; e_string "bar"; e_string "foobar"]) in (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 () = let%bind () =
expect_eq program "patch_op_empty" expect_eq program "patch_op_empty"
(e_set [e_string "foo" ; e_string "bar"]) (e_set [e_string "foo" ; e_string "bar"])