Skip to content

Commit efe069c

Browse files
committed
Add UI tests for string escape warnings.
1 parent 2dff700 commit efe069c

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

src/test/ui/str/str-escape.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// check-pass
2+
fn main() {
3+
let s = "\
4+
5+
";
6+
//~^^^ WARNING multiple lines skipped by escaped newline
7+
let s = "foo\
8+
  bar
9+
";
10+
//~^^^ WARNING non-ASCII whitespace symbol '\u{a0}' is not skipped
11+
}

src/test/ui/str/str-escape.stderr

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
warning: multiple lines skipped by escaped newline
2+
--> $DIR/str-escape.rs:3:14
3+
|
4+
LL | let s = "\
5+
| ______________^
6+
LL | |
7+
LL | | ";
8+
| |_____________^ skipping everything up to and including this point
9+
10+
warning: non-ASCII whitespace symbol '\u{a0}' is not skipped
11+
--> $DIR/str-escape.rs:7:17
12+
|
13+
LL | let s = "foo\
14+
| _________________^
15+
LL | |   bar
16+
| | ^ non-ASCII whitespace symbol '\u{a0}' is not skipped
17+
| |___|
18+
|
19+
20+
warning: 2 warnings emitted
21+

0 commit comments

Comments
 (0)