fix(ssh): restore the proxy timeout test after the i18n move

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` 通过。
This commit is contained in:
kuddev committed 2026-08-29 10:54:00 +08:00
1 parent 1a4e58ce11
commit 9855d57667
1 file changed
+10 -1
+10 -1
View File
@@ -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);
}