Skip to content

Commit cb728f6

Browse files
committed
Revert "Don’t mutate line endings in assertParseWithAllNewlineEndings (#2100)"
This reverts commit acc0320. rdar://114406758
1 parent 075c83e commit cb728f6

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

Tests/SwiftParserTest/translated/MultilineErrorsTests.swift

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,19 @@ extension ParserTestCase {
2727
file: StaticString = #file,
2828
line: UInt = #line
2929
) {
30-
// FIXME: We should run `assertParse` with every possible line ending here.
31-
assertParse(
32-
markedSource,
33-
substructure: expectedSubstructure,
34-
substructureAfterMarker: substructureAfterMarker,
35-
diagnostics: expectedDiagnostics,
36-
applyFixIts: applyFixIts,
37-
fixedSource: expectedFixedSource,
38-
file: file,
39-
line: line
40-
)
30+
for newline in ["\n", "\r", "\r\n"] {
31+
assertParse(
32+
markedSource.replacingOccurrences(of: "\n", with: newline),
33+
substructure: expectedSubstructure,
34+
substructureAfterMarker: substructureAfterMarker,
35+
diagnostics: expectedDiagnostics,
36+
applyFixIts: applyFixIts,
37+
fixedSource: expectedFixedSource,
38+
options: [.normalizeNewlinesInFixedSource],
39+
file: file,
40+
line: line
41+
)
42+
}
4143
}
4244
}
4345

0 commit comments

Comments
 (0)