Skip to content

Commit 578d8ac

Browse files
authored
Merge pull request #135 from benlangmuir/range-up
[test] Use the improved location support for a range
2 parents d78c243 + 89fdb9d commit 578d8ac

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Tests/INPUTS/ClangStdHeaderCanary/std_header_canary.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
#include <cstdint>
66

77
void test() {
8-
uint64_t /*unused_b*/b;
8+
uint64_t /*unused_b*/b/*<unused_b:end*/;
99
}

Tests/SourceKitTests/LocalClangTests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ final class LocalClangTests: XCTestCase {
142142
XCTAssertNil(resp)
143143
}
144144

145-
146145
func testClangStdHeaderCanary() throws {
147146
guard let ws = try staticSourceKitTibsWorkspace(name: "ClangStdHeaderCanary") else { return }
148147
if ToolchainRegistry.shared.default?.clangd == nil { return }
@@ -154,7 +153,7 @@ final class LocalClangTests: XCTestCase {
154153
ws.sk.handleNextNotification { (note: Notification<PublishDiagnostics>) in
155154
XCTAssertEqual(note.params.diagnostics, [
156155
Diagnostic(
157-
range: Position(loc) ..< Position(line: loc.line - 1, utf16index: loc.column),
156+
range: Position(loc) ..< Position(ws.testLoc("unused_b:end")),
158157
severity: .warning,
159158
source: nil,
160159
message: "Unused variable 'b'")

0 commit comments

Comments
 (0)