Initial commit

This commit is contained in:
Zoe
2026-09-19 14:53:40 -05:00
commit 75b3a01aee
10 changed files with 538 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
import { test } from "node:test";
import assert from "node:assert/strict";
import { execFileSync } from "node:child_process";
import { quoteShell, remote } from "../src/ssh.js";
test("shell quoting preserves literal input", () => {
for (const value of ["", "hello", "a'b", "$(echo unsafe);\n*", "こんにちは"]) {
assert.equal(execFileSync("sh", ["-c", `printf %s ${quoteShell(value)}`], { encoding: "utf8" }), value);
}
});
test("rejects option-like SSH destinations", () => {
assert.throws(() => remote("-oProxyCommand=bad", "true"));
assert.throws(() => remote("home extra", "true"));
});