Files
pikasTech-unidesk/scripts/src/gh-body-input.test.ts
T
Codex 3a17d3b9fd 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>
2026-07-10 13:13:03 +02:00

34 lines
994 B
TypeScript

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: "-" },
});
});
});