From 88bd9bcd9e1ad9d815d7e7111c27f58cdc935f97 Mon Sep 17 00:00:00 2001 From: nrq6993-a11y Date: Mon, 19 Oct 2026 18:19:49 +0300 Subject: [PATCH] G4: Touch Type drag test treats omitted zero dx as no kerning Co-authored-by: Cursor --- crates/tools/src/touchtype.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/tools/src/touchtype.rs b/crates/tools/src/touchtype.rs index bcc973109..05a3f31b5 100644 --- a/crates/tools/src/touchtype.rs +++ b/crates/tools/src/touchtype.rs @@ -561,7 +561,10 @@ mod tests { let acts = drag(&mut t, &cx, first, first + Vec2::new(10.0, -4.0)); let p3 = preview(&acts[1]); assert_eq!(p3["start"], json!(0)); - assert!(close(p3["dx"].as_f64().unwrap(), 0.0) && close(p3["dy"].as_f64().unwrap(), 4.0), "{p3}"); + assert!( + close(p3.get("dx").and_then(|v| v.as_f64()).unwrap_or(0.0), 0.0) && close(p3["dy"].as_f64().unwrap(), 4.0), + "{p3}" + ); } #[test]