Skip to content

Commit

Permalink
Add UI tests for string escape warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
jesyspa committed Aug 11, 2021
1 parent 2dff700 commit efe069c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/test/ui/str/str-escape.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 21 additions & 0 deletions src/test/ui/str/str-escape.stderr
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit efe069c

Please sign in to comment.