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 @@ _ = ##"""
6868 """##
6969// CHECK: "a raw string with \"\"\" in it"
7070
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+
71102let foo = " Interpolation "
72103_ = #"\b\b \#( foo) \#( foo) Kappa"#
73104// CHECK: "\\b\\b "
Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ let _ = #"\##("invalid")"#
99// expected-error@-1{{too many '#' characters in delimited escape}}
1010// expected-error@-2{{invalid escape sequence in literal}}
1111
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+
1217let _ = ####"invalid"###
1318// expected-error@-1{{unterminated string literal}}
1419
@@ -17,8 +22,16 @@ let _ = ###"invalid"######
1722// expected-error@-2{{consecutive statements on a line must be separated by ';'}}
1823// expected-error@-3{{expected expression}}
1924
20- let _ = ##"""##
25+ let _ = ##"""aa
2126 foobar
22- ## """##
27+ aa """##
2328// expected-error@-3{{multi-line string literal content must begin on a new line}}{{14-14=\n}}
2429// 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