Skip to content

Commit

Permalink
Add more tests for raw string literal
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Aug 9, 2019
1 parent 30cbdc7 commit b825cdd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tests/ui/single_char_pattern.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,7 @@ fn main() {
// Raw string
x.split('a');
x.split('a');
x.split('a');
x.split('\'');
x.split('#');
}
3 changes: 3 additions & 0 deletions tests/ui/single_char_pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,7 @@ fn main() {
// Raw string
x.split(r"a");
x.split(r#"a"#);
x.split(r###"a"###);
x.split(r###"'"###);
x.split(r###"#"###);
}
20 changes: 19 additions & 1 deletion tests/ui/single_char_pattern.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,23 @@ error: single-character string constant used as pattern
LL | x.split(r#"a"#);
| ^^^^^^ help: try using a char instead: `'a'`

error: aborting due to 24 previous errors
error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:60:13
|
LL | x.split(r###"a"###);
| ^^^^^^^^^^ help: try using a char instead: `'a'`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:61:13
|
LL | x.split(r###"'"###);
| ^^^^^^^^^^ help: try using a char instead: `'/''`

error: single-character string constant used as pattern
--> $DIR/single_char_pattern.rs:62:13
|
LL | x.split(r###"#"###);
| ^^^^^^^^^^ help: try using a char instead: `'#'`

error: aborting due to 27 previous errors

0 comments on commit b825cdd

Please sign in to comment.