Skip to content

Commit 932e7a4

Browse files
committed
Update nested parameter parsing test
1 parent 3a375e6 commit 932e7a4

File tree

1 file changed

+14
-22
lines changed

1 file changed

+14
-22
lines changed

Tests/SwiftFormatTests/Core/DocumentationCommentTests.swift

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -269,32 +269,24 @@ final class DocumentationCommentTests: XCTestCase {
269269
└─ Text " A function."
270270
"""
271271
)
272-
XCTAssertTrue(paramComment.bodyNodes.isEmpty)
273-
XCTAssertEqual(paramComment.parameterLayout, .separated)
274-
XCTAssertEqual(paramComment.parameters.count, 2)
275-
XCTAssertEqual(paramComment.parameters[0].name, "x")
272+
XCTAssertEqual(paramComment.bodyNodes.count, 1)
276273
XCTAssertEqual(
277-
paramComment.parameters[0].comment.briefSummary?.debugDescription(),
274+
paramComment.bodyNodes[0].debugDescription(),
278275
"""
279-
Paragraph
280-
└─ Text " A value."
281-
"""
282-
)
283-
XCTAssertEqual(paramComment.parameters[1].name, "y")
284-
XCTAssertEqual(
285-
paramComment.parameters[1].comment.briefSummary?.debugDescription(),
286-
"""
287-
Paragraph
288-
└─ Text " Another value."
289-
"""
290-
)
291-
XCTAssertEqual(
292-
paramComment.returns?.debugDescription(),
293-
"""
294-
Paragraph
295-
└─ Text " A result."
276+
UnorderedList
277+
├─ ListItem
278+
│ └─ Paragraph
279+
│ └─ Text "Parameter x: A value."
280+
├─ ListItem
281+
│ └─ Paragraph
282+
│ └─ Text "Parameter y: Another value."
283+
└─ ListItem
284+
└─ Paragraph
285+
└─ Text "Returns: A result."
296286
"""
297287
)
288+
XCTAssertTrue(paramComment.parameters.isEmpty)
289+
XCTAssertNil(paramComment.returns)
298290
XCTAssertNil(paramComment.throws)
299291
}
300292
}

0 commit comments

Comments
 (0)