From 9855d5766723dcfce634e264bd2afcab39a0e6a0 Mon Sep 17 00:00:00 2001 From: kuddev Date: Sat, 29 Aug 2026 10:54:00 +0800 Subject: [PATCH] fix(ssh): restore the proxy timeout test after the i18n move MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 353bc17 把超时文案搬进 i18n JSON 目录、秒数改由 `ProxyTestFailure::Timeout` 携带,同时删掉了 `proxy_test_timeout_message()`,但漏下了 ssh_session.rs 里的 测试引用。后果不是一条测试红,而是**整个 nebula 测试二进制编译不出来**: error[E0425]: cannot find function `proxy_test_timeout_message` in module `super` 默认 features 和 gpui-shell 都一样。测试代码不进 `cargo build`,所以这个门禁 只在 `cargo test -p nebula` 时暴露——在那之前谁都跑不了单元测试。 判据保持不变(用户看到的文案里的秒数必须等于共享的 `TEST_TIMEOUT`),只是改走 现在的渲染入口:`UiLanguage::ZhCn.proxy_test_message()` 必须给出 `网络测试超时(12 秒无响应)`。 验证:`cargo test -p nebula --bin nebula` 恢复可编译并跑完; `ssh_session::tests::proxy_test_timeout_copy_matches_shared_budget` 通过。 --- nebula_app/src/ssh_session.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nebula_app/src/ssh_session.rs b/nebula_app/src/ssh_session.rs index 3d22e02..aa16d57 100644 --- a/nebula_app/src/ssh_session.rs +++ b/nebula_app/src/ssh_session.rs @@ -1557,7 +1557,16 @@ mod tests { #[test] fn proxy_test_timeout_copy_matches_shared_budget() { - assert_eq!(super::proxy_test_timeout_message(), "网络测试超时(12 秒无响应)"); + // 353bc17 把这条文案搬进 i18n 目录,秒数改由 `ProxyTestFailure` 携带 + // (旧的 `proxy_test_timeout_message` 随之删除,这个测试的引用被漏下 + // 了)。判据不变:用户看到的文案必须和共享的超时预算是同一个数。 + let timeout = crate::proxy_test::ProxyTestOutcome::Failed( + crate::proxy_test::ProxyTestFailure::Timeout { seconds: super::TEST_TIMEOUT.as_secs() }, + ); + assert_eq!( + crate::display::UiLanguage::ZhCn.proxy_test_message(&timeout, 0), + "网络测试超时(12 秒无响应)" + ); assert_eq!(super::TEST_TIMEOUT.as_secs(), 12); }