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).
This commit is contained in:
yetone
2026-11-17 23:02:00 +08:00
parent fe41216b01
commit db02200ce1
+3 -1
View File
@@ -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