Skip to content

Commit 4f3a5c9

Browse files
authored
Merge pull request swiftlang#158 from benlangmuir/master-next-fix-clangd-diag
[test] Loosen test to account for clangd change in master-next
2 parents e003e54 + dcbc43f commit 4f3a5c9

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Tests/SourceKitTests/LocalClangTests.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,12 @@ final class LocalClangTests: XCTestCase {
150150
let expectation = XCTestExpectation(description: "diagnostics")
151151

152152
ws.sk.handleNextNotification { (note: Notification<PublishDiagnostics>) in
153-
XCTAssertEqual(note.params.diagnostics, [
154-
Diagnostic(
155-
range: Position(loc) ..< Position(ws.testLoc("unused_b:end")),
156-
severity: .warning,
157-
source: nil,
158-
message: "Unused variable 'b'")
159-
])
160-
153+
// Don't use exact equality because of differences in recent clang.
154+
XCTAssertEqual(note.params.diagnostics.count, 1)
155+
XCTAssertEqual(note.params.diagnostics.first?.range,
156+
PositionRange(Position(loc) ..< Position(ws.testLoc("unused_b:end"))))
157+
XCTAssertEqual(note.params.diagnostics.first?.severity, .warning)
158+
XCTAssertEqual(note.params.diagnostics.first?.message, "Unused variable 'b'")
161159
expectation.fulfill()
162160
}
163161

0 commit comments

Comments
 (0)