Skip to content

Commit 50497ff

Browse files
committed
[Lexer] Add a couple of test cases for extended escaping str literal
1 parent a5759b7 commit 50497ff

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

test/Parse/raw_string.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,6 @@ _ = #"""
132132
]
133133
"""#
134134
// CHECK: "[\n {\n \"id\": \"12345\",\n \"title\": \"A title that \\\"contains\\\" \\\\\\\"\"\n }\n]"
135+
136+
_ = #"# #"#
137+
// CHECK: "# #"

test/Parse/raw_string_errors.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@ let _ = ###"invalid"######
1616
// expected-error@-1{{too many '#' characters in closing delimiter}}{{24-27=}}
1717
// expected-error@-2{{consecutive statements on a line must be separated by ';'}}
1818
// expected-error@-3{{expected expression}}
19+
20+
let _ = ##"""##
21+
foobar
22+
##"""##
23+
// expected-error@-3{{multi-line string literal content must begin on a new line}}{{14-14=\n}}
24+
// expected-error@-2{{multi-line string literal closing delimiter must begin on a new line}}{{5-5=\n}}

0 commit comments

Comments
 (0)