Add more tests for raw string literal

This commit is contained in:
Lzu Tao 2019-08-09 10:45:49 +07:00
parent 30cbdc7491
commit b825cddb6d
3 changed files with 25 additions and 1 deletions

View File

@ -57,4 +57,7 @@ fn main() {
// Raw string
x.split('a');
x.split('a');
x.split('a');
x.split('\'');
x.split('#');
}

View File

@ -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###"#"###);
}

View File

@ -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