mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-03 06:31:42 +01:00
test(web): a press, release and press in one frame keep all three events
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
e9c1232ce7
commit
8138fc12e7
1 file changed
+11
@@ -86,6 +86,17 @@ mod tests {
|
||||
assert!(tap(&mut harness, true), "a third tap opens it again");
|
||||
}
|
||||
|
||||
/// A fast double tap delivered in one frame: each event changes the button's state, so none is
|
||||
/// a twin.
|
||||
#[test]
|
||||
fn a_press_release_press_in_one_frame_keeps_all_three() {
|
||||
let ctx = egui::Context::default();
|
||||
let p = pos2(10.0, 10.0);
|
||||
let mut raw = RawInput { time: Some(1.0), events: vec![button(p, true), button(p, false), button(p, true)], ..Default::default() };
|
||||
drop_twins(&ctx, &mut raw);
|
||||
assert_eq!(raw.events.len(), 3);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_press_held_for_long_still_passes() {
|
||||
let ctx = egui::Context::default();
|
||||
|
||||
Reference in new issue
Block a user