Add UI tests for string escape warnings.

This commit is contained in:
Anton Golov 2021-08-11 12:13:24 +02:00
parent 2dff700c4f
commit efe069c599
2 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,11 @@
// check-pass
fn main() {
let s = "\
";
//~^^^ WARNING multiple lines skipped by escaped newline
let s = "foo\
  bar
";
//~^^^ WARNING non-ASCII whitespace symbol '\u{a0}' is not skipped
}

View file

@ -0,0 +1,21 @@
warning: multiple lines skipped by escaped newline
--> $DIR/str-escape.rs:3:14
|
LL | let s = "\
| ______________^
LL | |
LL | | ";
| |_____________^ skipping everything up to and including this point
warning: non-ASCII whitespace symbol '\u{a0}' is not skipped
--> $DIR/str-escape.rs:7:17
|
LL | let s = "foo\
| _________________^
LL | |   bar
| | ^ non-ASCII whitespace symbol '\u{a0}' is not skipped
| |___|
|
warning: 2 warnings emitted