Skip to content

Commit 56c6ac6

Browse files
committed
Make PullDiagnosticsTests.testCodeActions pass with older toolchains
The Fix-It message that we are testing here has changed in swiftlang/swift#67909. Accept both the old and the new message to make sure SourceKit-LSP tests also pass with older toolchains (e.g. if are using Xcode 15.0, which doesn’t contain the change yet).
1 parent 2fb2e3a commit 56c6ac6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Tests/SourceKitLSPTests/PullDiagnosticsTests.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@ final class PullDiagnosticsTests: XCTestCase {
118118

119119
XCTAssertEqual(actions.count, 1)
120120
let action = try XCTUnwrap(actions.first)
121-
XCTAssertEqual(action.title, "add stubs for conformance")
121+
// Allow the action message to be the one before or after
122+
// https://github.com/apple/swift/pull/67909, ensuring this test passes with
123+
// a sourcekitd that contains the change from that PR as well as older
124+
// toolchains that don't contain the change yet.
125+
XCTAssert([
126+
"add stubs for conformance",
127+
"do you want to add protocol stubs?"
128+
].contains(action.title))
122129
}
123130
}

0 commit comments

Comments
 (0)