diff options
Diffstat (limited to 'test/c/enum_tup_match.sail')
| -rw-r--r-- | test/c/enum_tup_match.sail | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/c/enum_tup_match.sail b/test/c/enum_tup_match.sail new file mode 100644 index 00000000..852cebc1 --- /dev/null +++ b/test/c/enum_tup_match.sail @@ -0,0 +1,24 @@ +default Order dec + +$include <prelude.sail> + +val "print_endline" : string -> unit + +enum foo = { + Bar, + Baz +} + +val test : (foo, foo) -> bool + +function test(x, y) = + match (x, y) { + (Baz, Baz) => false, + (Bar, Bar) => true, + (_, _) => false + } + +function main() : unit -> unit = { + assert(test(Bar, Bar)); + print_endline("ok") +} |
