Skip to content

Commit f3efac4

Browse files
committed
Relax assertion around testIntegrationTest
Depending on whether clangd has finished indexing/built an AST/something, we get different code completion results. The actual integration test is only checking that we have a result with `insertText` `clib_func`, which is satisfied independently of whether clangd’s progress. Adopt the same assertion in this test case.
1 parent 715796f commit f3efac4

File tree

1 file changed

+2
-36
lines changed

1 file changed

+2
-36
lines changed

Tests/SourceKitLSPTests/WorkspaceTests.swift

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -879,41 +879,7 @@ final class WorkspaceTests: XCTestCase {
879879
let cCompletionResponse = try await project.testClient.send(
880880
CompletionRequest(textDocument: TextDocumentIdentifier(clibcUri), position: clibcPositions["2️⃣"])
881881
)
882-
XCTAssertEqual(
883-
cCompletionResponse.items,
884-
[
885-
// rdar://73762053: This should also suggest clib_other
886-
CompletionItem(
887-
label: " clib_func",
888-
kind: .text,
889-
deprecated: true,
890-
sortText: "41b99800clib_func",
891-
filterText: "clib_func",
892-
insertText: "clib_func",
893-
insertTextFormat: .plain,
894-
textEdit: .textEdit(TextEdit(range: Range(clibcPositions["2️⃣"]), newText: "clib_func"))
895-
),
896-
CompletionItem(
897-
label: " include",
898-
kind: .text,
899-
deprecated: true,
900-
sortText: "41d85b70include",
901-
filterText: "include",
902-
insertText: "include",
903-
insertTextFormat: .plain,
904-
textEdit: .textEdit(TextEdit(range: Range(clibcPositions["2️⃣"]), newText: "include"))
905-
),
906-
CompletionItem(
907-
label: " void",
908-
kind: .text,
909-
deprecated: true,
910-
sortText: "41e677bbvoid",
911-
filterText: "void",
912-
insertText: "void",
913-
insertTextFormat: .plain,
914-
textEdit: .textEdit(TextEdit(range: Range(clibcPositions["2️⃣"]), newText: "void"))
915-
),
916-
]
917-
)
882+
// rdar://73762053: This should also suggest clib_other
883+
XCTAssert(cCompletionResponse.items.contains(where: { $0.insertText == "clib_func" }))
918884
}
919885
}

0 commit comments

Comments
 (0)