From db02200ce120474ffd67aed038934d4749d39397 Mon Sep 17 00:00:00 2001 From: yetone Date: Tue, 17 Nov 2026 23:02:00 +0800 Subject: [PATCH] gui tests: i18n-keys leaves Go test files out of a plugin's words (#6877) "a plugin's words are its own" read every .go file but dropped only whole-line comments. claude_image_budget_test.go (2896e82cc) has a trailing comment "the user's message of turn i, with an image", so the routing plugin's ", with an image" counted as said elsewhere, and the test was red on main for a day. A _test.go file says nothing to the window, so it is left out, as tests/ and testdata/ already are. Run on mote (mote-run, node --test internal/gui/tests/i18n-keys.test.cjs) at origin/main 659e8850a plus this change: 4 pass. Broken by hand: without the _test.go clause, red on that test (the #6877 line); a non-test internal/gateway/zz_probe.go saying ", with an image" is still red with the change, so the guard keeps its reach. Not run: the rest of the GUI suite (this test reads files only). --- internal/gui/tests/i18n-keys.test.cjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/gui/tests/i18n-keys.test.cjs b/internal/gui/tests/i18n-keys.test.cjs index cf5adde38..23a2221ff 100644 --- a/internal/gui/tests/i18n-keys.test.cjs +++ b/internal/gui/tests/i18n-keys.test.cjs @@ -47,7 +47,9 @@ test("a plugin's words are its own", () => { if (e.isDirectory()) { // third_party is vendored code, which says nothing to the window if (!["node_modules", ".git", "site", "tests", "testdata", "docs", "third_party"].includes(e.name)) walk(p); - } else if (/\.(go|js|html|css)$/.test(e.name) && e.name !== "i18n.js") { + } else if (/\.(go|js|html|css)$/.test(e.name) && e.name !== "i18n.js" && !e.name.endsWith("_test.go")) { + // a Go test says nothing to the window: claude_image_budget_test.go's + // "turn i, with an image" turned this red for a day (#6877) let text = fs.readFileSync(p, "utf8"); // a comment line says nothing to the window: Go's "(View routing, // the …" and "Use the library's sets …" cite a plugin's words