diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-07-09 08:44:46 +0200 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-07-28 06:53:38 +0200 |
| commit | 2411134c78706c1bb852da2fba4d90567ce4a5f3 (patch) | |
| tree | 4444809376369f7ca851c0c05faac28e7c675d0b /src/test | |
| parent | 2f55354759c8b2140110a361ed43465ce5f4b785 (diff) | |
| download | rust-2411134c78706c1bb852da2fba4d90567ce4a5f3.tar.gz rust-2411134c78706c1bb852da2fba4d90567ce4a5f3.zip | |
Update tests wrt. recovery of range patterns.
Diffstat (limited to 'src/test')
5 files changed, 26 insertions, 5 deletions
diff --git a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.rs b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.rs index d95c4b09994..a3b7a80642a 100644 --- a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.rs +++ b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.rs @@ -2,7 +2,10 @@ fn main() { match [5..4, 99..105, 43..44] { - [_, 99.., _] => {}, //~ ERROR unexpected token: `,` + [_, 99.., _] => {}, + //~^ ERROR `X..` range patterns are not supported + //~| ERROR arbitrary expressions aren't allowed in patterns + //~| ERROR only char and numeric types are allowed in range patterns _ => {}, } } diff --git a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.rs b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.rs index 95677e34dd7..197953a1dc4 100644 --- a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.rs +++ b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.rs @@ -2,7 +2,11 @@ fn main() { match [5..4, 99..105, 43..44] { - [_, 99..] => {}, //~ ERROR unexpected token: `]` + [_, 99..] => {}, + //~^ ERROR `X..` range patterns are not supported + //~| ERROR arbitrary expressions aren't allowed in patterns + //~| ERROR pattern requires 2 elements but array has 3 + //~| ERROR only char and numeric types are allowed in range patterns _ => {}, } } diff --git a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.rs b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.rs index 3bf5da710ef..782777c1079 100644 --- a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.rs +++ b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.rs @@ -2,7 +2,11 @@ fn main() { match [5..4, 99..105, 43..44] { - [..9, 99..100, _] => {}, //~ ERROR expected one of `,` or `]`, found `9` + [..9, 99..100, _] => {}, + //~^ ERROR `..X` range patterns are not supported + //~| ERROR arbitrary expressions aren't allowed in patterns + //~| ERROR only char and numeric types are allowed in range patterns + //~| ERROR mismatched types _ => {}, } } diff --git a/src/test/ui/parser/pat-tuple-4.rs b/src/test/ui/parser/pat-tuple-4.rs index 76f60d94bc8..9eedb0f9023 100644 --- a/src/test/ui/parser/pat-tuple-4.rs +++ b/src/test/ui/parser/pat-tuple-4.rs @@ -1,5 +1,10 @@ fn main() { match 0 { - (.. pat) => {} //~ ERROR expected one of `)` or `,`, found `pat` + (.. pat) => {} + //~^ ERROR `..X` range patterns are not supported + //~| ERROR arbitrary expressions aren't allowed in patterns + //~| ERROR cannot find value `pat` in this scope + //~| ERROR exclusive range pattern syntax is experimental + //~| ERROR only char and numeric types are allowed in range patterns } } diff --git a/src/test/ui/parser/pat-tuple-5.rs b/src/test/ui/parser/pat-tuple-5.rs index d4f05a5eb52..5e191ca88e2 100644 --- a/src/test/ui/parser/pat-tuple-5.rs +++ b/src/test/ui/parser/pat-tuple-5.rs @@ -1,5 +1,10 @@ fn main() { match (0, 1) { - (pat ..) => {} //~ ERROR unexpected token: `)` + (pat ..) => {} + //~^ ERROR `X..` range patterns are not supported + //~| ERROR arbitrary expressions aren't allowed in patterns + //~| ERROR cannot find value `pat` in this scope + //~| ERROR exclusive range pattern syntax is experimental + //~| ERROR only char and numeric types are allowed in range patterns } } |
