Skip to content

Commit b02bbac

Browse files
committed
test(edge-cases): use toShellPath for platform-aware path formatting in xargs/parallel tests
Wrap otherDir paths with toShellPath to ensure correct path formatting across platforms, particularly Windows where backslash separators differ.
1 parent c6fb23b commit b02bbac

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/core/analyze/edge-cases.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
22
import { mkdirSync, mkdtempSync, rmSync } from 'node:fs';
33
import { tmpdir } from 'node:os';
44
import { join } from 'node:path';
5-
import { assertAllowed, assertBlocked, runGuard, withEnv } from '../../helpers.ts';
5+
import { assertAllowed, assertBlocked, runGuard, toShellPath, withEnv } from '../../helpers.ts';
66

77
describe('edge cases', () => {
88
let tempDir: string;
@@ -426,7 +426,7 @@ describe('edge cases', () => {
426426
mkdirSync(otherDir);
427427

428428
assertBlocked(
429-
`echo ok | xargs env -C ${otherDir} rm -rf build`,
429+
`echo ok | xargs env -C ${toShellPath(otherDir)} rm -rf build`,
430430
'rm -rf outside cwd',
431431
projectDir,
432432
);
@@ -545,7 +545,7 @@ describe('edge cases', () => {
545545
mkdirSync(otherDir);
546546

547547
assertBlocked(
548-
`parallel env -C ${otherDir} rm -rf {} ::: build`,
548+
`parallel env -C ${toShellPath(otherDir)} rm -rf {} ::: build`,
549549
'rm -rf outside cwd',
550550
projectDir,
551551
);

0 commit comments

Comments
 (0)