Skip to content

Commit b31f8ac

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). rdar://116706363
1 parent d0fc00c commit b31f8ac

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
@@ -132,6 +132,13 @@ final class PullDiagnosticsTests: XCTestCase {
132132

133133
XCTAssertEqual(actions.count, 1)
134134
let action = try XCTUnwrap(actions.first)
135-
XCTAssertEqual(action.title, "add stubs for conformance")
135+
// Allow the action message to be the one before or after
136+
// https://github.com/apple/swift/pull/67909, ensuring this test passes with
137+
// a sourcekitd that contains the change from that PR as well as older
138+
// toolchains that don't contain the change yet.
139+
XCTAssert([
140+
"add stubs for conformance",
141+
"do you want to add protocol stubs?"
142+
].contains(action.title))
136143
}
137144
}

0 commit comments

Comments
 (0)