Skip to content

Commit bd1ff8a

Browse files
committed
Rename ws in tests to project
Now that all the types that model test projects are suffixed `Project` instead of `Workspace`, the `ws` abbreviation doesn‘t make sense. It also never really fit with the new style of avoiding abbreviations. Rename all occurrences to `project`. rdar://124727401
1 parent 582a100 commit bd1ff8a

24 files changed

+442
-429
lines changed

Tests/LanguageServerProtocolTests/CodingTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ func with<T>(_ value: T, mutate: (inout T) -> Void) -> T {
13471347

13481348
extension String {
13491349
func indented(_ spaces: Int, skipFirstLine: Bool = false) -> String {
1350-
let ws = String(repeating: " ", count: spaces)
1351-
return (skipFirstLine ? "" : ws) + self.replacingOccurrences(of: "\n", with: "\n" + ws)
1350+
let spaces = String(repeating: " ", count: spaces)
1351+
return (skipFirstLine ? "" : spaces) + self.replacingOccurrences(of: "\n", with: "\n" + spaces)
13521352
}
13531353
}

Tests/SourceKitDTests/CrashRecoveryTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ final class CrashRecoveryTests: XCTestCase {
202202
func testClangdCrashRecoveryReopensWithCorrectBuildSettings() async throws {
203203
try SkipUnless.longTestsEnabled()
204204

205-
let ws = try await MultiFileTestProject(files: [
205+
let project = try await MultiFileTestProject(files: [
206206
"main.cpp": """
207207
#if FOO
208208
void 1️⃣foo2️⃣() {}
@@ -219,7 +219,7 @@ final class CrashRecoveryTests: XCTestCase {
219219
""",
220220
])
221221

222-
let (mainUri, positions) = try ws.openDocument("main.cpp")
222+
let (mainUri, positions) = try project.openDocument("main.cpp")
223223

224224
// Do a sanity check and verify that we get the expected result from a hover response before crashing clangd.
225225

@@ -232,22 +232,22 @@ final class CrashRecoveryTests: XCTestCase {
232232
textDocument: TextDocumentIdentifier(mainUri),
233233
position: positions["3️⃣"]
234234
)
235-
let preCrashHighlightResponse = try await ws.testClient.send(highlightRequest)
235+
let preCrashHighlightResponse = try await project.testClient.send(highlightRequest)
236236
precondition(
237237
preCrashHighlightResponse == expectedHighlightResponse,
238238
"Sanity check failed. The Hover response was not what we expected, even before crashing sourcekitd"
239239
)
240240

241241
// Crash clangd
242242

243-
try await crashClangd(for: ws.testClient, document: mainUri)
243+
try await crashClangd(for: project.testClient, document: mainUri)
244244

245245
// Check that we have re-opened the document with the correct build settings
246246
// If we did not recover the correct build settings, document highlight would
247247
// pick the definition of foo() in the #else branch.
248248

249249
await assertNoThrow {
250-
let postCrashHighlightResponse = try await ws.testClient.send(highlightRequest)
250+
let postCrashHighlightResponse = try await project.testClient.send(highlightRequest)
251251
XCTAssertEqual(postCrashHighlightResponse, expectedHighlightResponse)
252252
}
253253
}

0 commit comments

Comments
 (0)