Add test for PascaLIGO remove syntax which appears to work

This commit is contained in:
John David Pressman 2019-10-08 11:54:49 -07:00
parent 7cf75c54c8
commit 88de350264
2 changed files with 8 additions and 0 deletions

View File

@ -13,6 +13,10 @@ function add_op (const s : set(string)) : set(string) is
function remove_op (const s : set(string)) : set(string) is function remove_op (const s : set(string)) : set(string) is
begin skip end with set_remove("foobar" , s) begin skip end with set_remove("foobar" , s)
// Test the PascaLIGO syntactic sugar for set removal vs. the function call
function remove_syntax (var s : set(string)) : set(string) is
begin remove "foobar" from set s; end with s
function mem_op (const s : set(string)) : bool is function mem_op (const s : set(string)) : bool is
begin skip end with set_mem("foobar" , s) begin skip end with set_mem("foobar" , s)

View File

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