Skip to content

Commit 104a4c3

Browse files
committed
Don’t emit messages about mismatched diagnostic messages if the diagnostic count doesn’t match
1 parent 4f1286f commit 104a4c3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Tests/SwiftParserTest/Assertions.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,10 @@ func AssertParse<Node: RawSyntaxNodeProtocol>(
244244
Expected \(expectedDiagnostics.count) diagnostics but received \(diags.count):
245245
\(diags.map(\.debugDescription).joined(separator: "\n"))
246246
""", file: file, line: line)
247-
}
248-
for (diag, expectedDiag) in zip(diags, expectedDiagnostics) {
249-
AssertDiagnostic(diag, in: tree, markerLocations: markerLocations, expected: expectedDiag, file: expectedDiag.file, line: expectedDiag.line)
247+
} else {
248+
for (diag, expectedDiag) in zip(diags, expectedDiagnostics) {
249+
AssertDiagnostic(diag, in: tree, markerLocations: markerLocations, expected: expectedDiag, file: expectedDiag.file, line: expectedDiag.line)
250+
}
250251
}
251252

252253
// Applying Fix-Its

0 commit comments

Comments
 (0)