Skip to content

Commit a31b2c1

Browse files
committed
test(memory-leak): fix cwd assertion for windows git-bash path
1 parent cb5caa0 commit a31b2c1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/tests/memory-leak.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import * as path from "path";
66
import { SessionManager } from "../session";
77
import { handleBashTool } from "../tools/bash-handler";
88
import * as state from "../common/state";
9+
import { posixPathToWindowsPath } from "../common/shell-utils";
910
import type { ToolExecutionContext } from "../tools/executor";
1011

1112
const originalHome = process.env.HOME;
@@ -173,7 +174,9 @@ test("Deleted session id reuse should reset bash cwd to project root", async ()
173174

174175
const output = (second.output ?? "").trim();
175176
const normalizedRoot = fs.realpathSync(projectRoot);
176-
assert.ok(output.startsWith(normalizedRoot), `expected cwd to reset to ${normalizedRoot}, got ${output}`);
177+
const normalizedOutput =
178+
process.platform === "win32" && output.startsWith("/") ? posixPathToWindowsPath(output) : output;
179+
assert.ok(normalizedOutput.startsWith(normalizedRoot), `expected cwd to reset to ${normalizedRoot}, got ${output}`);
177180
});
178181

179182
test("deleteSession should not kill untracked stale persisted pids", async () => {

0 commit comments

Comments
 (0)