Skip to content

Commit 9b1d2e7

Browse files
Fix Build Warnings (#2107)
Fixes some build warnings and clarifies a test.
1 parent c75efe5 commit 9b1d2e7

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

CodeEdit/Features/LSP/Registry/PackageSourceParser/PackageSourceParser.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ enum PackageSourceParser {
4040
false
4141
}
4242

43-
var source = PackageSource(
43+
let source = PackageSource(
4444
sourceId: sourceId,
4545
type: isSourceBuild ? .sourceBuild : .github,
4646
pkgName: packageName,

CodeEditTests/Features/Tasks/TaskManagerTests.swift

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,28 @@ class TaskManagerTests {
2626
#expect(taskManager.availableTasks == mockWorkspaceSettings.tasks)
2727
}
2828

29-
@Test(arguments: [SettingsData.TerminalShell.zsh, SettingsData.TerminalShell.bash])
30-
func executeSelectedTask(_ shell: SettingsData.TerminalShell) async throws {
31-
Settings.shared.preferences.terminal.shell = shell
29+
@Test
30+
func executeTaskInZsh() async throws {
31+
Settings.shared.preferences.terminal.shell = .zsh
32+
33+
let task = CETask(name: "Test Task", command: "echo 'Hello World'")
34+
mockWorkspaceSettings.tasks.append(task)
35+
taskManager.selectedTaskID = task.id
36+
taskManager.executeActiveTask()
37+
38+
await waitForExpectation(timeout: .seconds(10)) {
39+
self.taskManager.activeTasks[task.id]?.status == .finished
40+
} onTimeout: {
41+
Issue.record("Status never changed to finished.")
42+
}
43+
44+
let outputString = try #require(taskManager.activeTasks[task.id]?.output?.getBufferAsString())
45+
#expect(outputString.contains("Hello World"))
46+
}
47+
48+
@Test
49+
func executeTaskInBash() async throws {
50+
Settings.shared.preferences.terminal.shell = .bash
3251

3352
let task = CETask(name: "Test Task", command: "echo 'Hello World'")
3453
mockWorkspaceSettings.tasks.append(task)

CodeEditUITests/Features/UtilityArea/TerminalUtility/TerminalUtilityUITests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class TerminalUtilityUITests: XCTestCase {
2828
}
2929

3030
func testTerminalsInputData() throws {
31-
var terminal = utilityArea.textViews["Terminal Emulator"]
31+
let terminal = utilityArea.textViews["Terminal Emulator"]
3232
XCTAssertTrue(terminal.exists)
3333
terminal.click()
3434
terminal.typeText("echo hello world")

0 commit comments

Comments
 (0)