test(shell): add unit tests for escapeShellArg

- 11 tests covering Unix and Windows escaping behavior
- Tests for quotes, percent signs, carets, newlines, tabs
- Fixes comment inaccuracy (backslash → doubling)
This commit is contained in:
kaitranntt committed 2026-02-05 10:36:55 -05:00
1 parent ed91f21994
commit 48aa3cca30
2 files changed
+80 -1

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ export function escapeShellArg(arg: string): string {
const isWindows = process.platform === 'win32';
if (isWindows) {
// cmd.exe: Use double quotes, escape inner double quotes with backslash
// cmd.exe: Use double quotes, escape inner double quotes by doubling them
// cmd.exe interprets "" as escaped double quote inside quoted string
// Strip newlines/tabs that can break cmd.exe parsing
return (