Skip to content

Commit 93f45c7

Browse files
committed
test(process): align caller coverage with batch quoting contract
1 parent fb241db commit 93f45c7

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

‎src/hooks/gmail.windows.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ describe("resolveGogServeInvocation on Windows", () => {
4646
"/d",
4747
"/s",
4848
"/c",
49-
'""C:\\Program Files\\gog\\gog.cmd" gmail watch serve --account [email protected]"',
49+
'""C:\\Program Files\\gog\\gog.cmd" "gmail" "watch" "serve" "--account" "[email protected]""',
5050
],
5151
windowsHide: true,
5252
windowsVerbatimArguments: true,
5353
});
5454
});
5555
});
5656

57-
it("escapes caret arguments for gog .cmd wrappers", async () => {
57+
it("quotes caret arguments for gog .cmd wrappers", async () => {
5858
const { resolveGogServeInvocation } = await importGmailWithExecutable("gog.cmd");
5959

6060
await withMockedWindowsPlatform(async () => {
@@ -70,7 +70,7 @@ describe("resolveGogServeInvocation on Windows", () => {
7070
"/d",
7171
"/s",
7272
"/c",
73-
"gog.cmd gmail watch serve --label release/^^1",
73+
'""gog.cmd" "gmail" "watch" "serve" "--label" "release/^1""',
7474
]);
7575
expect(invocation.windowsVerbatimArguments).toBe(true);
7676
});

‎src/process/windows-command.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,13 @@ describe.runIf(process.platform === "win32")("Windows batch argv preservation",
223223
);
224224

225225
it.each(["argv.cmd", "argv with spaces.cmd", "argv^caret.cmd", "node.exe"])(
226-
"preserves the argument matrix through a real PTY running %s",
226+
"preserves literal arguments through a real PTY running %s",
227227
async (file) => {
228228
await withTempDir("openclaw-batch-argv-pty-", async (cwd) => {
229-
const args = cases.flatMap((testCase) => testCase.args);
229+
const args =
230+
file === "node.exe"
231+
? ["alpha", "", "two words", "two\twords", "A&B", "100%", "left|right", "<in", ">out"]
232+
: cases.flatMap((testCase) => testCase.args);
230233
const script = path.join(cwd, "argv.cjs");
231234
const output = path.join(cwd, "received.json");
232235
await writeFile(

0 commit comments

Comments
 (0)