File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
Tests/SwiftBasicFormatTest Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -342,7 +342,7 @@ final class BasicFormatTest: XCTestCase {
342
342
)
343
343
}
344
344
345
- func testNodeHavingParentNode ( ) {
345
+ func testSubTreeNode ( ) {
346
346
let decl : DeclSyntax = """
347
347
func test() {
348
348
print(1)
@@ -359,4 +359,25 @@ final class BasicFormatTest: XCTestCase {
359
359
"""
360
360
)
361
361
}
362
+
363
+ func testSubTreeNodeWithIndentedParentNode( ) {
364
+ let decl : DeclSyntax = """
365
+ struct X {
366
+ func test() {
367
+ print(1)
368
+ }
369
+ }
370
+ """
371
+
372
+ let body = decl. cast ( StructDeclSyntax . self) . memberBlock. members. first!. decl. cast ( FunctionDeclSyntax . self) . body!
373
+
374
+ assertFormatted (
375
+ source: body. formatted ( ) . description,
376
+ expected: """
377
+ {
378
+ print(1)
379
+ }
380
+ """
381
+ )
382
+ }
362
383
}
You can’t perform that action at this time.
0 commit comments