Add UI tests for string escape warnings.
This commit is contained in:
parent
2dff700c4f
commit
efe069c599
2 changed files with 32 additions and 0 deletions
11
src/test/ui/str/str-escape.rs
Normal file
11
src/test/ui/str/str-escape.rs
Normal 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
|
||||
}
|
21
src/test/ui/str/str-escape.stderr
Normal file
21
src/test/ui/str/str-escape.stderr
Normal 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
|
||||
|
Loading…
Reference in a new issue