Update tests wrt. recovery of range patterns.

This commit is contained in:
Mazdak Farrokhzad 2019-07-09 08:44:46 +02:00
parent 2f55354759
commit 2411134c78
5 changed files with 26 additions and 5 deletions

View File

@ -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
_ => {},
}
}

View File

@ -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
_ => {},
}
}

View File

@ -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
_ => {},
}
}

View File

@ -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
}
}

View File

@ -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
}
}