test(acp): make shell workdir location assertion windows-safe (#32306)
This commit is contained in:
parent
51461429f4
commit
e4d4b07e7d
@ -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([])
|
||||
|
||||
Loading…
Reference in New Issue
Block a user