mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-03 05:19:21 +00:00
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:
1 parent
ed91f21994
commit
48aa3cca30
2 files changed
+80
-1
No files matched your search
@@ -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 (
|
||||
|
||||
Reference in new issue
Block a user