diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/typecheck/pass/not_pattern.sail | 14 | ||||
| -rw-r--r-- | test/typecheck/pass/not_pattern/v1.expect | 5 | ||||
| -rw-r--r-- | test/typecheck/pass/not_pattern/v1.sail | 15 | ||||
| -rw-r--r-- | test/typecheck/pass/or_pattern.sail | 16 | ||||
| -rw-r--r-- | test/typecheck/pass/or_pattern/v1.expect | 5 | ||||
| -rw-r--r-- | test/typecheck/pass/or_pattern/v1.sail | 14 |
6 files changed, 69 insertions, 0 deletions
diff --git a/test/typecheck/pass/not_pattern.sail b/test/typecheck/pass/not_pattern.sail new file mode 100644 index 00000000..818b1b82 --- /dev/null +++ b/test/typecheck/pass/not_pattern.sail @@ -0,0 +1,14 @@ +default Order dec + +$include <prelude.sail> + +let x : int = 5 + +val main : unit -> unit + +function main() = { + match x { + ~(3) => (), + _ => () + } +}
\ No newline at end of file diff --git a/test/typecheck/pass/not_pattern/v1.expect b/test/typecheck/pass/not_pattern/v1.expect new file mode 100644 index 00000000..9de82d1f --- /dev/null +++ b/test/typecheck/pass/not_pattern/v1.expect @@ -0,0 +1,5 @@ +Type error at file "not_pattern/v1.sail", line 12, character 7 to line 12, character 7 + + ~([41my[0m) => (), + +Bindings are not allowed in this context diff --git a/test/typecheck/pass/not_pattern/v1.sail b/test/typecheck/pass/not_pattern/v1.sail new file mode 100644 index 00000000..490e9856 --- /dev/null +++ b/test/typecheck/pass/not_pattern/v1.sail @@ -0,0 +1,15 @@ +default Order dec + +$include <prelude.sail> + +let x : int = 5 + +val main : unit -> unit + +function main() = { + match x { + ~(3) => (), + ~(y) => (), + _ => () + } +}
\ No newline at end of file diff --git a/test/typecheck/pass/or_pattern.sail b/test/typecheck/pass/or_pattern.sail new file mode 100644 index 00000000..a6e11ecd --- /dev/null +++ b/test/typecheck/pass/or_pattern.sail @@ -0,0 +1,16 @@ +default Order dec + +$include <prelude.sail> + +let x : int = 5 + +val main : unit -> unit + +function main() = { + match x { + 3 | 4 => (), + (1 | 2) | 3 => (), + 1 | (2 | 3) => (), + _ => () + } +}
\ No newline at end of file diff --git a/test/typecheck/pass/or_pattern/v1.expect b/test/typecheck/pass/or_pattern/v1.expect new file mode 100644 index 00000000..edf07f03 --- /dev/null +++ b/test/typecheck/pass/or_pattern/v1.expect @@ -0,0 +1,5 @@ +Type error at file "or_pattern/v1.sail", line 11, character 5 to line 11, character 5 + + [41my[0m | z => (), + +Bindings are not allowed in this context diff --git a/test/typecheck/pass/or_pattern/v1.sail b/test/typecheck/pass/or_pattern/v1.sail new file mode 100644 index 00000000..21bc87e8 --- /dev/null +++ b/test/typecheck/pass/or_pattern/v1.sail @@ -0,0 +1,14 @@ +default Order dec + +$include <prelude.sail> + +let x : int = 5 + +val main : unit -> unit + +function main() = { + match x { + y | z => (), + _ => () + } +}
\ No newline at end of file |
