From 4db44e2ede1996cd52f48c422fd78a34322f0d13 Mon Sep 17 00:00:00 2001 From: csr588 <18280981898@163.com> Date: Sun, 8 Nov 2026 13:19:41 +0800 Subject: [PATCH] test(autocomplete): cover all preloaded specs and Apple extension term MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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. --- components/terminal/autocomplete/descriptions.zh-TW.json | 4 ++-- .../terminal/autocompleteDescriptionI18n.batch.test.ts | 2 +- components/terminal/figSpecLoader.test.ts | 7 ++++++- scripts/generate-autocomplete-descriptions-zh-TW.mjs | 4 ++++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/components/terminal/autocomplete/descriptions.zh-TW.json b/components/terminal/autocomplete/descriptions.zh-TW.json index 386f91f23..ecf4db6a8 100644 --- a/components/terminal/autocomplete/descriptions.zh-TW.json +++ b/components/terminal/autocomplete/descriptions.zh-TW.json @@ -3007,7 +3007,7 @@ "Progress status is reported on the standard error stream by default when it is attached to a terminal, unless --quiet is specified. This flag forces progress status even if the standard error stream is not directed to a terminal": "預設情況下,當標準錯誤流連線到終端時會報告進度狀態,除非指定了 --quiet。即使標準錯誤流未指向終端,此標誌也會強制報告進度狀態", "Progress status is reported on the standard error stream by default when it is attached to a terminal, unless -q is specified": "預設情況下,當標準錯誤流連線到終端時會報告進度狀態,除非指定了 -q", "Progress status is reported on the standard error stream by default when it is attached to a terminal, unless -q is specified. This flag forces progress status even if the standard error stream is not directed to a terminal": "預設情況下,當標準錯誤流連線到終端時會報告進度狀態,除非指定了 -q。即使標準錯誤流未指向終端,此標誌也會強制報告進度狀態", - "Prohibit the socket from using the cellular network interface. This option is an Apple addition": "禁止套接字使用蜂窩網路介面。此選項是 Apple 的擴充", + "Prohibit the socket from using the cellular network interface. This option is an Apple addition": "禁止套接字使用蜂窩網路介面。此選項是 Apple 的擴充功能", "Project name": "專案名稱", "Promote one or more nodes to manager in the swarm": "將一個或多個節點提升為 swarm 中的 manager", "Prompt before each invocation of the diff tool": "每次呼叫差異工具前提示", @@ -4641,7 +4641,7 @@ "Turn on rename detection, optionally setting the similarity threshold": "啟用重新命名檢測,並可選擇設定相似度閾值", "Turn on storage of metadata in extended file attributes": "啟用在擴充檔案屬性中儲存後設資料", "Turn on the pre-push hook. The default is --verify, giving the hook a chance to prevent the push. With": "啟用 pre-push 鉤子。預設為 --verify,使鉤子有機會阻止推送。With", - "Turn on value of next option": "啟用指定的 NeXT 相容選項(Apple 擴充)", + "Turn on value of next option": "啟用指定的 NeXT 相容選項(Apple 擴充功能)", "Turn progress on/off explicitly. If neither is specified, progress is shown if standard error is connected to a terminal. Note that not all merge strategies may support progress reporting": "顯式啟用或停用進度。若均未指定,則當標準錯誤連線到終端時顯示進度。注意並非所有合併策略都支援進度報告", "Turn sequences of nulls into sparse blocks": "將連續的空位元組轉換為稀疏塊", "Turns off analytics": "停用分析", diff --git a/components/terminal/autocompleteDescriptionI18n.batch.test.ts b/components/terminal/autocompleteDescriptionI18n.batch.test.ts index 977c681b7..2d697a1fd 100644 --- a/components/terminal/autocompleteDescriptionI18n.batch.test.ts +++ b/components/terminal/autocompleteDescriptionI18n.batch.test.ts @@ -110,7 +110,7 @@ test("batch zh-TW spot checks cover corrected semantics", () => { ); assert.equal( traditional["Turn on value of next option"], - "啟用指定的 NeXT 相容選項(Apple 擴充)", + "啟用指定的 NeXT 相容選項(Apple 擴充功能)", ); }); diff --git a/components/terminal/figSpecLoader.test.ts b/components/terminal/figSpecLoader.test.ts index 0b3da84e5..72c1ee505 100644 --- a/components/terminal/figSpecLoader.test.ts +++ b/components/terminal/figSpecLoader.test.ts @@ -9,7 +9,12 @@ test("preload common specs includes dnf alongside yum and apt", () => { for (const command of ["ln", "stat", "wc", "cut", "uniq", "tee", "xargs"]) { assert.ok(COMMON_FIG_SPECS.includes(command), `${command} should be preloaded`); } - for (const command of ["basename", "dirname", "readlink", "more", "seq", "dig", "htop"]) { + 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`); } }); diff --git a/scripts/generate-autocomplete-descriptions-zh-TW.mjs b/scripts/generate-autocomplete-descriptions-zh-TW.mjs index 5e6064672..049127326 100644 --- a/scripts/generate-autocomplete-descriptions-zh-TW.mjs +++ b/scripts/generate-autocomplete-descriptions-zh-TW.mjs @@ -61,6 +61,10 @@ const TAIWAN_PHRASE_FIXES = [ ["ALPN TLS 擴充", "ALPN TLS 擴充功能"], ["NPN TLS 擴充", "NPN TLS 擴充功能"], ["數據", "資料"], + // “extension” as a noun keeps 功能; the generic rule above only covers the + // adjective “extended” (擴充屬性, 擴充正規表示式, 擴充標頭). + ["Apple 的擴充", "Apple 的擴充功能"], + ["(Apple 擴充)", "(Apple 擴充功能)"], ]; function toTraditionalTaiwan(text, convert) {