mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-23 16:42:19 +00:00
- Assert every one of the 22 batch-4 commands in COMMON_FIG_SPECS; the old loop only covered 7, so dropping a preload entry could pass unnoticed. - Keep the noun “extension” as 擴充功能: the generic 擴充套件→擴充 rule is right for “extended” compounds (擴充屬性, 擴充標頭, 擴充正規表示式), but Apple's option descriptions need the noun form.
26 lines
1.1 KiB
TypeScript
26 lines
1.1 KiB
TypeScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
import { COMMON_FIG_SPECS, normalizeCommandName } from "./autocomplete/figSpecLoader";
|
|
|
|
test("preload common specs includes dnf alongside yum and apt", () => {
|
|
assert.ok(COMMON_FIG_SPECS.includes("apt"));
|
|
assert.ok(COMMON_FIG_SPECS.includes("yum"));
|
|
assert.ok(COMMON_FIG_SPECS.includes("dnf"));
|
|
for (const command of ["ln", "stat", "wc", "cut", "uniq", "tee", "xargs"]) {
|
|
assert.ok(COMMON_FIG_SPECS.includes(command), `${command} should be preloaded`);
|
|
}
|
|
const batch4Commands = [
|
|
"echo", "which", "paste", "pwd", "clear", "su", "crontab", "env", "uname",
|
|
"base64", "date", "id", "split", "seq", "join", "dig", "dd", "htop",
|
|
"basename", "dirname", "readlink", "more",
|
|
];
|
|
for (const command of batch4Commands) {
|
|
assert.ok(COMMON_FIG_SPECS.includes(command), `${command} should be preloaded`);
|
|
}
|
|
});
|
|
|
|
test("normalizeCommandName strips path and extension", () => {
|
|
assert.equal(normalizeCommandName("/usr/bin/dnf"), "dnf");
|
|
assert.equal(normalizeCommandName("DNF"), "dnf");
|
|
});
|