Skip to content

Commit 8d82fb7

Browse files
Yigtwxxclaude
andcommitted
test(path): resolve the temp root before asserting absolute reads
The drive-relative absolute-path test opened a root at the raw mkdtemp() result, which is /var/... on macOS and an 8.3 short name on Windows CI. openRoot() resolves the root, so the unresolved path the test passed back in read as outside-workspace and failed every non-Linux leg. main fails an equivalent repro the same way, so this is the test skipping the realpath convention the rest of the suite follows, not a regression in the drive-relative rejection. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Dpz7Mnp2xh7WHWHVAnPWtK
1 parent 2a10498 commit 8d82fb7

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎test/windows-path.test.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { mkdtemp, readFile, rm } from "node:fs/promises";
1+
import { mkdtemp, readFile, realpath, rm } from "node:fs/promises";
22
import os from "node:os";
33
import path from "node:path";
44
import { describe, expect, it } from "vitest";
@@ -103,7 +103,12 @@ describe("drive-relative relative paths", () => {
103103
});
104104

105105
it("keeps accepting an absolute path that stays inside the root", async () => {
106-
const rootDir = await mkdtemp(path.join(os.tmpdir(), "fs-safe-drive-relative-absolute-"));
106+
// The temp dir must be resolved: macOS hands back /var/... for a /private/var/...
107+
// root and Windows CI hands back an 8.3 short name, either of which reads as
108+
// outside the root once openRoot() resolves it.
109+
const rootDir = await realpath(
110+
await mkdtemp(path.join(os.tmpdir(), "fs-safe-drive-relative-absolute-")),
111+
);
107112
try {
108113
const root = await openRoot(rootDir);
109114
await root.write("note.txt", "kept");

0 commit comments

Comments
 (0)