fix(windows): owned-read requires the read-only attribute on Windows; setup.ps1 passes arguments NUL-separated through a private file; Windows-only tests expect the owned-read approval

This commit is contained in:
garrytan committed 2026-10-08 16:51:43 +00:00
1 parent cb919cc770
commit d2b601d9ae
5 files changed
+21 -9

No files matched your search

+3 -2
View File
@@ -39,8 +39,9 @@ function runPs1(dir: string, args: string[], env: Record<string, string | undefi
}
describe('setup.ps1', () => {
test('passes arguments as an array to a constant bash script', () => {
expect(SOURCE).toContain(`& $bash -c 'exec ./setup "$@"' setup @args`);
test('passes arguments NUL-separated through a private file to a constant bash script', () => {
expect(SOURCE).toContain(`& $bash -c 'mapfile -d "" -t argv < "$1"; rm -f "$1"; exec ./setup "\${argv[@]}"' setup $argFile`);
expect(SOURCE).toContain('foreach ($arg in $args) { $writer.Write([string]$arg); $writer.Write([char]0) }');
expect(SOURCE).not.toMatch(/-join|Invoke-Expression|\biex\b|git-bash\.exe/);
expect([...SOURCE].every((c) => c.charCodeAt(0) < 128)).toBe(true);
});