Skip to content

Commit 6d6dc28

Browse files
committed
Adds a test case for simple function declaration formatting
1 parent ef1e6b0 commit 6d6dc28

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Tests/SwiftSyntaxBuilderTest/FunctionTests.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,20 @@ final class FunctionTests: XCTestCase {
4343
AssertBuildResult(buildable, "test(value1, p2: value2, value3, p4: value4, value5)")
4444
}
4545

46+
func testFunctionDeclBuilder() {
47+
let builder = FunctionDecl("""
48+
func test(_ p1: Int, p2: Int, _ p3: Int, p4: Int, _ p5: Int) -> Int {
49+
return p1 + p2 + p3 + p4 + p5
50+
}
51+
""")
52+
53+
AssertBuildResult(builder, """
54+
func test(_ p1: Int, p2: Int, _ p3: Int, p4: Int, _ p5: Int) -> Int {
55+
return p1 + p2 + p3 + p4 + p5
56+
}
57+
""")
58+
}
59+
4660
func testMultilineFunctionParameterList() {
4761
let builder = FunctionDecl("""
4862
func test(

0 commit comments

Comments
 (0)