Skip to content

Commit 2750608

Browse files
committed
Add a test case that fully wraps a function declaration.
1 parent 7307beb commit 2750608

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Tests/PrettyPrinterTests/FunctionDeclTests.swift

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,35 @@ public class FunctionDeclTests: PrettyPrintTestCase {
140140

141141
assertPrettyPrintEqual(input: input, expected: expected, linelength: 60)
142142
}
143+
144+
public func testFunctionFullWrap() {
145+
let input =
146+
"""
147+
public func index<Elements: Collection, Element>(of element: Element, in collection: Elements) -> Elements.Index? where Elements.Element == Element, Element: Equatable {
148+
let a = 123
149+
let b = "abc"
150+
}
151+
"""
152+
153+
let expected =
154+
"""
155+
public func index<
156+
Elements: Collection,
157+
Element
158+
>(
159+
of element: Element,
160+
in collection: Elements
161+
) -> Elements.Index?
162+
where
163+
Elements.Element == Element,
164+
Element: Equatable
165+
{
166+
let a = 123
167+
let b = "abc"
168+
}
169+
170+
"""
171+
172+
assertPrettyPrintEqual(input: input, expected: expected, linelength: 30)
173+
}
143174
}

0 commit comments

Comments
 (0)