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 {
342342 )
343343 }
344344
345- func testNodeHavingParentNode ( ) {
345+ func testSubTreeNode ( ) {
346346 let decl : DeclSyntax = """
347347 func test() {
348348 print(1)
@@ -359,4 +359,25 @@ final class BasicFormatTest: XCTestCase {
359359 """
360360 )
361361 }
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+ }
362383}
You can’t perform that action at this time.
0 commit comments