2019-07-26 16:54:25 -05:00
|
|
|
// run-pass
|
2017-09-19 00:40:04 -05:00
|
|
|
// Test old and new syntax for inclusive range patterns.
|
|
|
|
|
2019-05-30 05:20:30 -05:00
|
|
|
#![allow(ellipsis_inclusive_range_patterns)]
|
|
|
|
|
2017-09-19 00:40:04 -05:00
|
|
|
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 });
|
|
|
|
}
|