Skip to content

Commit b825cdd

Browse files
committed
Add more tests for raw string literal
1 parent 30cbdc7 commit b825cdd

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

tests/ui/single_char_pattern.fixed

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,7 @@ fn main() {
5757
// Raw string
5858
x.split('a');
5959
x.split('a');
60+
x.split('a');
61+
x.split('\'');
62+
x.split('#');
6063
}

tests/ui/single_char_pattern.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,7 @@ fn main() {
5757
// Raw string
5858
x.split(r"a");
5959
x.split(r#"a"#);
60+
x.split(r###"a"###);
61+
x.split(r###"'"###);
62+
x.split(r###"#"###);
6063
}

tests/ui/single_char_pattern.stderr

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,23 @@ error: single-character string constant used as pattern
144144
LL | x.split(r#"a"#);
145145
| ^^^^^^ help: try using a char instead: `'a'`
146146

147-
error: aborting due to 24 previous errors
147+
error: single-character string constant used as pattern
148+
--> $DIR/single_char_pattern.rs:60:13
149+
|
150+
LL | x.split(r###"a"###);
151+
| ^^^^^^^^^^ help: try using a char instead: `'a'`
152+
153+
error: single-character string constant used as pattern
154+
--> $DIR/single_char_pattern.rs:61:13
155+
|
156+
LL | x.split(r###"'"###);
157+
| ^^^^^^^^^^ help: try using a char instead: `'/''`
158+
159+
error: single-character string constant used as pattern
160+
--> $DIR/single_char_pattern.rs:62:13
161+
|
162+
LL | x.split(r###"#"###);
163+
| ^^^^^^^^^^ help: try using a char instead: `'#'`
164+
165+
error: aborting due to 27 previous errors
148166

0 commit comments

Comments
 (0)