fix: harden Windows trans helpers
Resolve #1691 by preserving argv boundaries, adding bounded native rg and wc/skill query support, surfacing WSL-to-Windows hints, and splitting the oversized SSH module and embedded remote scripts. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { spawnSync } from "node:child_process";
|
||||
import { describe, expect, test } from "bun:test";
|
||||
|
||||
describe("gh Markdown stdin", () => {
|
||||
test("preserves backticks, dollar expressions, and heredoc markers byte-for-byte", () => {
|
||||
const body = [
|
||||
"目标合并分支: 不适用",
|
||||
"",
|
||||
"`G14` 与 $HOME 保持原样。",
|
||||
"",
|
||||
"<<'INNER'",
|
||||
"markdown `code` ${literal}",
|
||||
"INNER",
|
||||
"",
|
||||
].join("\n");
|
||||
const script = [
|
||||
'import { readMarkdownBodyFileOrStdin } from "./scripts/src/gh/body-input.ts";',
|
||||
'process.stdout.write(JSON.stringify(readMarkdownBodyFileOrStdin("-")));',
|
||||
].join(" ");
|
||||
const result = spawnSync(process.execPath, ["-e", script], {
|
||||
cwd: process.cwd(),
|
||||
input: body,
|
||||
encoding: "utf8",
|
||||
});
|
||||
|
||||
expect(result.status).toBe(0);
|
||||
expect(result.stderr).toBe("");
|
||||
expect(JSON.parse(result.stdout)).toEqual({
|
||||
body,
|
||||
bodySource: { kind: "stdin", path: "-" },
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user