Add test for set patch functionality

Resolves LIGO-127
This commit is contained in:
John David Pressman 2019-10-09 23:13:25 -07:00
parent 2f60c85aa8
commit c82076281f
2 changed files with 9 additions and 0 deletions

View File

@ -17,6 +17,11 @@ function remove_op (const s : set(string)) : set(string) is
function remove_syntax (var s : set(string)) : set(string) is
begin remove "foobar" from set s; end with s
function patch_op (var s: set(string)) : set(string) is
begin patch s with set ["foobar"]; end with s
function mem_op (const s : set(string)) : bool is
begin skip end with set_mem("foobar" , s)

View File

@ -245,6 +245,10 @@ let set_arithmetic () : unit result =
expect_eq program "remove_syntax"
(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 "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 "mem_op"
(e_set [e_string "foo" ; e_string "bar" ; e_string "foobar"])