Skip to content

Commit 01d637c

Browse files
nexxelndavidgut1982
authored andcommitted
test(acp): make shell workdir location assertion windows-safe (anomalyco#32306)
1 parent e003a29 commit 01d637c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/opencode/test/acp/tool.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { resolve } from "path"
12
import { describe, expect, test } from "bun:test"
23
import {
34
completedToolContent,
@@ -38,8 +39,9 @@ describe("acp tool conversion", () => {
3839
{ path: "/tmp/outside" },
3940
])
4041
expect(toLocations("bash", { cmd: "pwd" }, "/workspace")).toEqual([{ path: "/workspace" }])
42+
// Relative workdir resolves against cwd via the platform path resolver (backslashes on Windows).
4143
expect(toLocations("bash", { command: "pwd", workdir: "subdir" }, "/workspace")).toEqual([
42-
{ path: "/workspace/subdir" },
44+
{ path: resolve("/workspace", "subdir") },
4345
])
4446
expect(toLocations("bash", { command: "pwd", workdir: "/abs/dir" }, "/workspace")).toEqual([{ path: "/abs/dir" }])
4547
expect(toLocations("bash", { command: "printf hello" })).toEqual([])

0 commit comments

Comments
 (0)