- 새 src/commands/prompt.ts — PromptSpec · renderPrompt(키워드 물음은 「또는」 없음) · matchOption(initget 줄임) · 세션 기억 · OPT · SELECT_OBJECTS - 새 inputController/prompt-input.ts — routeTyped 사다리(점 · 옵션 묻는 중 명령 이름 거절 · 식 · 단위 거절 · 투명 ') · 알림 줄 · 덧물음 · cancelActiveCommand · undoCommand - 새 tools/factories/end-command.ts — final(END) 갈고리 → 같은 틱 선택 도구 · state.ts 갈고리 · LASTPOINT - sequence-tool v2 — ROUTE · id · prompt · when · next · options · keyword · loopFrom · escCommits · pickfirst · 확정 뒤 기본 끝 · Esc 늘 끝 - 흠 — N1 ②③ · N5 · N6 · N11 · N18(앞글자 실행 없앰) · H1(Ctrl · Alt 글자 안 쌓음 · Ctrl+C · X · Shift+C · Shift+V · 1) · 우클릭 = 쉴 때 반복 · SE 뺌 · ED 더함 - 시험 — cad-drive 도우미 · prompt-frame · prompt-contract · 옛 시험 손질(keyboard-chain · ime-sink · command-catalog · input-prefs-cad · eraser 녹화) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QfHKQs7J3hQELKMWQMUJEy
35 lines
1.5 KiB
TypeScript
35 lines
1.5 KiB
TypeScript
/**
|
|
* CAD 명령 목록 거울(PLAN 332-2) — `commands/command-catalog.json` 이 registry(`commands.*.ts`)와 같은지.
|
|
* ☰ [설정] CAD 단축키 탭은 xstate 가 딸려 오지 않게 JSON 만 읽음 — 명령을 더하거나 별칭을 바꾸면 JSON 도 같이.
|
|
* 실행: cd B07_DesignDetail/openwebcad && npx vitest run --dir ../../resources/tester/cad command-catalog
|
|
*/
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
import catalog from "../../../B07_DesignDetail/openwebcad/src/commands/command-catalog.json";
|
|
import { getAllCommands } from "../../../B07_DesignDetail/openwebcad/src/commands/registry";
|
|
|
|
describe("command-catalog.json", () => {
|
|
it("registry 와 같은 명령 · 한글 이름 · 기본 별칭 · 차례", () => {
|
|
const live = getAllCommands().map((c) => ({
|
|
id: c.id,
|
|
label: c.label,
|
|
aliases: c.aliases ?? [],
|
|
}));
|
|
expect(catalog).toEqual(live);
|
|
});
|
|
|
|
it("기본 별칭 = 영문 · 숫자 · 안 겹침 · 명령 이름과 다름", () => {
|
|
const ids = new Set(catalog.map((c) => c.id));
|
|
const aliases = catalog.flatMap((c) => c.aliases);
|
|
expect(aliases.every((a) => /^[A-Z0-9]+$/.test(a))).toBe(true);
|
|
expect(new Set(aliases).size).toBe(aliases.length);
|
|
expect(aliases.filter((a) => ids.has(a))).toEqual([]);
|
|
});
|
|
|
|
it("337 acad.pgp 맞춤 — SE 없음(acad = DSETTINGS) · ED = TEXTEDIT", () => {
|
|
const owner = (alias: string) => catalog.find((c) => c.aliases.includes(alias))?.id;
|
|
expect(owner("SE")).toBeUndefined();
|
|
expect(owner("ED")).toBe("TEXTEDIT");
|
|
});
|
|
});
|