Skip to content

Commit e6e23e8

Browse files
committed
Fix missing newline for opening quote for multilines strings
1 parent 3bd861f commit e6e23e8

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

Tests/SwiftSyntaxBuilderTest/StringLiteralExprSyntaxTests.swift

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,4 +334,44 @@ final class StringLiteralExprSyntaxTests: XCTestCase {
334334
"""#
335335
)
336336
}
337+
338+
func testMultiStringOpeningQuote() {
339+
assertBuildResult(
340+
StringLiteralExprSyntax(openQuote: .multilineStringQuoteToken(), content: "a", closeQuote: .multilineStringQuoteToken()),
341+
#"""
342+
"""
343+
a
344+
"""
345+
"""#
346+
)
347+
348+
assertBuildResult(
349+
StringLiteralExprSyntax(
350+
openQuote: .multilineStringQuoteToken(),
351+
segments: StringLiteralSegmentsSyntax {
352+
.expressionSegment(
353+
ExpressionSegmentSyntax(
354+
expressions: TupleExprElementListSyntax {
355+
TupleExprElementSyntax(
356+
expression: StringLiteralExprSyntax(
357+
openQuote: .multilineStringQuoteToken(),
358+
content: "a",
359+
closeQuote: .multilineStringQuoteToken()
360+
)
361+
)
362+
}
363+
)
364+
)
365+
},
366+
closeQuote: .multilineStringQuoteToken()
367+
),
368+
#"""
369+
"""
370+
\("""
371+
a
372+
""")
373+
"""
374+
"""#
375+
)
376+
}
337377
}

0 commit comments

Comments
 (0)