Skip to content

Commit a5a69e6

Browse files
committed
Add a test case for stacking open-breaks.
This test case exercises the case where an open break occurs adjacent to a reset break when the reset break fires. This verifies that the open breaks stack indentation when they occur on the same line, but one of the breaks is at the start of the line.
1 parent 86d467f commit a5a69e6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Tests/SwiftFormatPrettyPrintTests/SwitchStmtTests.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ final class SwitchStmtTests: PrettyPrintTestCase {
8383
case "a": print("a")
8484
case "b", "c": print("bc")
8585
case "d", "e", "f", "g", "h": print("defgh")
86+
case someVeryLongVarName, someOtherLongVarName: foo(a: [1, 2, 3, 4, 5])
8687
default: print("default")
8788
}
8889
"""
@@ -96,6 +97,11 @@ final class SwitchStmtTests: PrettyPrintTestCase {
9697
case "d", "e", "f",
9798
"g", "h":
9899
print("defgh")
100+
case someVeryLongVarName,
101+
someOtherLongVarName:
102+
foo(a: [
103+
1, 2, 3, 4, 5,
104+
])
99105
default:
100106
print("default")
101107
}

0 commit comments

Comments
 (0)