File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Sources/SwiftSyntaxBuilder
Tests/SwiftSyntaxBuilderTest Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -249,7 +249,7 @@ extension StringLiteralExprSyntax {
249249 continue
250250
251251 // Special mode: counting a sequence of pounds until we reach its end.
252- case ( true , " # " ) :
252+ case ( true , _ ) where c . unicodeScalars . contains ( " # " ) :
253253 consecutivePounds += 1
254254 maxPounds = max ( maxPounds, consecutivePounds)
255255 case ( true , _) :
Original file line number Diff line number Diff line change @@ -71,6 +71,15 @@ final class StringLiteralTests: XCTestCase {
7171 )
7272 }
7373
74+ func testEscapePoundEmojis() {
75+ assertBuildResult(
76+ StringLiteralExprSyntax(content: ## " foo " #️⃣ " bar " ##),
77+ """
78+ ##"foo"#️⃣"bar"##
79+ """
80+ )
81+ }
82+
7483 func testEscapeInteropolation() {
7584 assertBuildResult(
7685 StringLiteralExprSyntax(content: ### " \##( foobar) \#( foobar) " ###),
You can’t perform that action at this time.
0 commit comments