Skip to content

Commit 6c53c64

Browse files
committed
Fail rename tests if no rename test markers exist in source
1 parent 015e486 commit 6c53c64

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Tests/SourceKitLSPTests/RenameTests.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,12 @@ private func assertSingleFileRename(
4848
) async throws {
4949
try await SkipUnless.sourcekitdSupportsRename()
5050
let testClient = try await TestSourceKitLSPClient()
51-
let uri = DocumentURI.for(.swift, testName: testName)
51+
let uri = DocumentURI.for(language ?? .swift, testName: testName)
5252
let positions = testClient.openDocument(markedSource, uri: uri, language: language)
53+
guard !positions.allMarkers.isEmpty else {
54+
XCTFail("Test case did not contain any markers at which to invoke the rename", file: file, line: line)
55+
return
56+
}
5357
for marker in positions.allMarkers {
5458
let prepareRenameResponse = try await testClient.send(
5559
PrepareRenameRequest(textDocument: TextDocumentIdentifier(uri), position: positions[marker])

0 commit comments

Comments
 (0)