S046: snail test

This commit is contained in:
astar76 2026-11-26 12:46:13 -06:00
commit fdbb007f53

View file

@ -97,10 +97,16 @@ mod tests {
use eframe::egui::pos2;;
for (on, repaints) in [(false, false), (true, true)] {
let ctx = Context::default();
let mut out = ctx.run_ui(RawInput::default(), |ui| {
button(ui.ctx(), &t, pos2(300.0, 300.0), on, "Ctrl+Shift+S");
});
out.textures_delta.clear();
let mut out = None;
// The first frames settle the layout; the last one tells.
for _ in 0..4 {
let mut o = ctx.run_ui(RawInput::default(), |ui| {
button(ui.ctx(), &t, pos2(300.0, 300.0), on, "Ctrl+Shift+S");
});
o.textures_delta.clear();
out = Some(o);
}
let out = out.unwrap();
let after = out.viewport_output[&ViewportId::ROOT].repaint_delay;
assert_eq!(after < std::time::Duration::from_secs(1), repaints, "on={on}: {after:?}");
}