summaryrefslogtreecommitdiffstats
path: root/src/test/ui/inc-range-pat.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/inc-range-pat.rs')
-rw-r--r--src/test/ui/inc-range-pat.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/inc-range-pat.rs b/src/test/ui/inc-range-pat.rs
new file mode 100644
index 000000000..1eb7dd0aa
--- /dev/null
+++ b/src/test/ui/inc-range-pat.rs
@@ -0,0 +1,12 @@
+// run-pass
+// Test old and new syntax for inclusive range patterns.
+
+#![allow(ellipsis_inclusive_range_patterns)]
+
+fn main() {
+ assert!(match 42 { 0 ... 100 => true, _ => false });
+ assert!(match 42 { 0 ..= 100 => true, _ => false });
+
+ assert!(match 'x' { 'a' ... 'z' => true, _ => false });
+ assert!(match 'x' { 'a' ..= 'z' => true, _ => false });
+}