Skip to content

Commit a648679

Browse files
authored
Merge pull request #1577 from kimdv/kimdv/fix-format-error
2 parents f34307b + eaf980d commit a648679

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

Tests/SwiftSyntaxTest/SyntaxVisitorTests.swift

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,27 @@ public class SyntaxVisitorTests: XCTestCase {
2929
///
3030
/// The source file is hard-coded so this test case doesn't need to depend on the parser.
3131
static var nestedFunctionsFile: SourceFileSyntax {
32+
let innerBody = CodeBlockSyntax(
33+
leftBrace: .leftBraceToken(),
34+
statements: CodeBlockItemListSyntax([
35+
CodeBlockItemSyntax(
36+
item: CodeBlockItemSyntax.Item(
37+
IntegerLiteralExprSyntax(
38+
digits: .integerLiteral(
39+
"0xG",
40+
leadingTrivia: [
41+
.newlines(1),
42+
.spaces(6),
43+
.blockComment("/*Unknown token */"),
44+
]
45+
)
46+
)
47+
)
48+
)
49+
]),
50+
rightBrace: .rightBraceToken(leadingTrivia: [.newlines(1), .spaces(4)])
51+
)
52+
3253
let source = SourceFileSyntax(
3354
statements: CodeBlockItemListSyntax([
3455
CodeBlockItemSyntax(
@@ -76,26 +97,7 @@ public class SyntaxVisitorTests: XCTestCase {
7697
rightParen: .rightParenToken(trailingTrivia: .space)
7798
)
7899
),
79-
body: CodeBlockSyntax(
80-
leftBrace: .leftBraceToken(),
81-
statements: CodeBlockItemListSyntax([
82-
CodeBlockItemSyntax(
83-
item: CodeBlockItemSyntax.Item(
84-
IntegerLiteralExprSyntax(
85-
digits: .integerLiteral(
86-
"0xG",
87-
leadingTrivia: [
88-
.newlines(1),
89-
.spaces(6),
90-
.blockComment("/*Unknown token */"),
91-
]
92-
)
93-
)
94-
)
95-
)
96-
]),
97-
rightBrace: .rightBraceToken(leadingTrivia: [.newlines(1), .spaces(4)])
98-
)
100+
body: innerBody
99101
)
100102
)
101103
)

0 commit comments

Comments
 (0)