diff --git a/crates/ui-egui/src/text/direction/tests.rs b/crates/ui-egui/src/text/direction/tests.rs index a0b5d34c82e..dda8b71f137 100644 --- a/crates/ui-egui/src/text/direction/tests.rs +++ b/crates/ui-egui/src/text/direction/tests.rs @@ -130,7 +130,7 @@ fn hebrew_and_urdu_mirror_the_shell_and_draw_their_letters() { assert!(dock_x(&h) < 600.0, "{code}: the dock moves to the left"); for label in ["File", "Help", "Layers"] { let text = i18n::tr(lang, label); - assert!(text.chars().any(|c| !c.is_ascii()), "{code}: {label} is translated"); + assert!(!text.is_ascii(), "{code}: {label} is translated"); assert!(h.ctx.fonts_mut(|f| f.has_glyphs(&egui::FontId::proportional(12.0), text)), "{code}: {text} has glyphs"); } h.state_mut().run("prefs.set", json!({"path": "interface.language", "value": "en"})).expect("back to English"); diff --git a/crates/ui-egui/src/widgets/type_ahead.rs b/crates/ui-egui/src/widgets/type_ahead.rs index a04cbd3ded2..ba693702771 100644 --- a/crates/ui-egui/src/widgets/type_ahead.rs +++ b/crates/ui-egui/src/widgets/type_ahead.rs @@ -206,10 +206,11 @@ mod tests { use egui_kittest::{Harness, kittest::Queryable}; let en = crate::i18n::Lang::EN; let de = crate::i18n::Lang::from_code("de").unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(300.0, 400.0)).build_ui_state( + // Short frames: the letters arrive well within the pause, so only the language change resets. + let mut h = Harness::builder().with_size(egui::vec2(300.0, 400.0)).with_step_dt(1.0 / 60.0).build_ui_state( |ui, (selected, lang): &mut (usize, crate::i18n::Lang)| { crate::i18n::with_language(*lang, || { - let options = [(0, "Normal"), (1, "Dissolve"), (2, "Darken")]; + let options = [(0, "Normal"), (1, "Dissolve"), (2, "Darken"), (3, "Add")]; crate::widgets::dropdown(ui, "lang-switch", "Mode", selected, &options, 120.0); }); }, @@ -224,9 +225,10 @@ mod tests { h.step(); h.state_mut().1 = en; h.step(); + assert!(super::list_open(&h.ctx), "the list stays open across the language change"); type_key(&h, egui::Key::A, "a"); h.run(); - assert_eq!(h.state().0, 1, "a alone picks nothing; the d typed before the change is gone (da would be Darken)"); + assert_eq!(h.state().0, 3, "a starts a new prefix (Add); the d typed before the change would make it da (Darken)"); } #[test]