Просмотр исходного кода

test(acp): make shell workdir location assertion windows-safe (#32306)

Shoubhit Dash 2 месяцев назад
Родитель
Сommit
e4d4b07e7d
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      packages/opencode/test/acp/tool.test.ts

+ 3 - 1
packages/opencode/test/acp/tool.test.ts

@@ -1,3 +1,4 @@
+import { resolve } from "path"
 import { describe, expect, test } from "bun:test"
 import {
   completedToolContent,
@@ -38,8 +39,9 @@ describe("acp tool conversion", () => {
       { path: "/tmp/outside" },
     ])
     expect(toLocations("bash", { cmd: "pwd" }, "/workspace")).toEqual([{ path: "/workspace" }])
+    // Relative workdir resolves against cwd via the platform path resolver (backslashes on Windows).
     expect(toLocations("bash", { command: "pwd", workdir: "subdir" }, "/workspace")).toEqual([
-      { path: "/workspace/subdir" },
+      { path: resolve("/workspace", "subdir") },
     ])
     expect(toLocations("bash", { command: "pwd", workdir: "/abs/dir" }, "/workspace")).toEqual([{ path: "/abs/dir" }])
     expect(toLocations("bash", { command: "printf hello" })).toEqual([])