Make English the repository working language (#5)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Yaowei Zheng
2026-07-20 17:45:02 +08:00
committed by GitHub
parent e80cde0ea6
commit 0eaaa54e25
136 changed files with 1515 additions and 1352 deletions
+8 -8
View File
@@ -2,40 +2,40 @@ import { describe, expect, it } from "vitest";
import { decideSigint } from "../src/commands/chat.js";
import { parseApprovalAnswer } from "../src/approval.js";
describe("decideSigint (Ctrl-C 行为状态机)", () => {
it("approving → deny(无论缓冲区是否有内容)", () => {
describe("decideSigint (Ctrl-C behavior state machine)", () => {
it("approving -> deny (whether or not the buffer has content)", () => {
expect(decideSigint("approving", false)).toBe("deny");
expect(decideSigint("approving", true)).toBe("deny");
});
it("running → abort(中断当前 Task,不退出)", () => {
it("running -> abort (interrupts the current Task, does not exit)", () => {
expect(decideSigint("running", false)).toBe("abort");
expect(decideSigint("running", true)).toBe("abort");
});
it("idle + 有输入 → clear(清空缓冲区)", () => {
it("idle + input -> clear (empties the buffer)", () => {
expect(decideSigint("idle", true)).toBe("clear");
});
it("idle + 无输入 → confirm-exit(弹出 y/N 退出确认)", () => {
it("idle + no input -> confirm-exit (shows the y/N exit confirmation)", () => {
expect(decideSigint("idle", false)).toBe("confirm-exit");
});
it("confirming-exit → exit(确认中再次 Ctrl-C 直接退出)", () => {
it("confirming-exit -> exit (a second Ctrl-C during confirmation exits immediately)", () => {
expect(decideSigint("confirming-exit", false)).toBe("exit");
expect(decideSigint("confirming-exit", true)).toBe("exit");
});
});
describe("parseApprovalAnswer", () => {
it("y / yes(trim、不区分大小写)→ allow;n / no → deny", () => {
it("y / yes (trimmed, case-insensitive) -> allow; n / no -> deny", () => {
expect(parseApprovalAnswer("y")).toBe("allow");
expect(parseApprovalAnswer(" YES \n")).toBe("allow");
expect(parseApprovalAnswer("Y")).toBe("allow");
expect(parseApprovalAnswer("n")).toBe("deny");
expect(parseApprovalAnswer("NO")).toBe("deny");
});
it("空/无关输入用 fallback(缺省 deny;工具审批传 allow)", () => {
it("empty/unrelated input uses the fallback (default deny; tool approval passes allow)", () => {
expect(parseApprovalAnswer("")).toBe("deny"); // default fallback
expect(parseApprovalAnswer("nope")).toBe("deny");
expect(parseApprovalAnswer("", "allow")).toBe("allow"); // tool approval defaults to allow