test(spill-local): exclude POSIX identity branches on Windows

This commit is contained in:
Dudu-0223
2026-08-24 21:20:23 +08:00
parent ca0e6f9707
commit d6f9931c4b
@@ -48,14 +48,20 @@ function isTrustedDirectory(stats: Stats): boolean {
if (!stats.isDirectory()) return false
/* v8 ignore next -- POSIX ownership and mode bits have no Windows equivalent. */
if (process.platform === 'win32' || process.geteuid === undefined) return true
/* v8 ignore start -- Windows takes the return above; POSIX tests exercise
owner and mode rejection. */
return stats.uid === process.geteuid() && (stats.mode & 0o022) === 0
/* v8 ignore stop */
}
/** Stable identity for de-duplicating aliases of one root. */
function rootIdentity(path: string, stats: Stats): string {
/* v8 ignore next -- Windows file indexes are not portable inode identities. */
if (process.platform === 'win32') return path.toLowerCase()
/* v8 ignore start -- Windows uses the canonical path identity above; POSIX
tests exercise device and inode identity. */
return `${String(stats.dev)}:${String(stats.ino)}`
/* v8 ignore stop */
}
/**