File tree Expand file tree Collapse file tree 2 files changed +46
-2
lines changed Expand file tree Collapse file tree 2 files changed +46
-2
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,37 @@ _ = ##"""
68
68
"""##
69
69
// CHECK: "a raw string with \"\"\" in it"
70
70
71
+ _ = #"""#
72
+ // CHECK: "\""
73
+
74
+ _ = #""""#
75
+ // CHECK: "\"\""
76
+
77
+ _ = #"""""#
78
+ // CHECK: "\"\"\""
79
+
80
+ _ = #""""""#
81
+ // CHECK: "\"\"\"\""
82
+
83
+ _ = ##""" foo # "# "##
84
+ // CHECK: "\"\" foo # \"# "
85
+
86
+ _ = ###""" "# "## "###
87
+ // CHECK: "\"\" \"# \"## "
88
+
89
+ _ = ###"""##"###
90
+ // CHECK: "\"\"##"
91
+
92
+ _ = " interpolating \( #"""false delimiter"# ) "
93
+ // CHECK: "interpolating "
94
+ // CHECK: "\"\"false delimiter"
95
+
96
+ _ = """
97
+ interpolating \( #"""false delimiters"""# )
98
+ """
99
+ // CHECK: "interpolating "
100
+ // CHECK: "\"\"false delimiters\"\""
101
+
71
102
let foo = " Interpolation "
72
103
_ = #"\b\b \#( foo) \#( foo) Kappa"#
73
104
// CHECK: "\\b\\b "
Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ let _ = #"\##("invalid")"#
9
9
// expected-error@-1{{too many '#' characters in delimited escape}}
10
10
// expected-error@-2{{invalid escape sequence in literal}}
11
11
12
+ let _ = ###"""invalid"### ###
13
+ // expected-error@-1{{too many '#' characters in closing delimiter}}{{26-29=}}
14
+ // expected-error@-2{{consecutive statements on a line must be separated by ';'}}
15
+ // expected-error@-3{{expected expression}}
16
+
12
17
let _ = ####"invalid"###
13
18
// expected-error@-1{{unterminated string literal}}
14
19
@@ -17,8 +22,16 @@ let _ = ###"invalid"######
17
22
// expected-error@-2{{consecutive statements on a line must be separated by ';'}}
18
23
// expected-error@-3{{expected expression}}
19
24
20
- let _ = ##"""##
25
+ let _ = ##"""aa
21
26
foobar
22
- ## """##
27
+ aa """##
23
28
// expected-error@-3{{multi-line string literal content must begin on a new line}}{{14-14=\n}}
24
29
// expected-error@-2{{multi-line string literal closing delimiter must begin on a new line}}{{5-5=\n}}
30
+
31
+ let _ = #""" foo "bar" #baz
32
+ """#
33
+ // expected-error@-2{{multi-line string literal content must begin on a new line}}{{13-13=\n}}
34
+
35
+ let _ = ###""" "# "##
36
+ """###
37
+ // expected-error@-2{{multi-line string literal content must begin on a new line}}{{15-15=\n}}
You can’t perform that action at this time.
0 commit comments