From 193470f80b9ed2bc9c6ac214bf43288b425ea088 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 14 Nov 2026 14:57:39 -0800 Subject: [PATCH] Tests: check where each Export Selection with options writes The test now asserts that the picked file and the given path receive the two writes, as well as the write count. --- crates/ui-egui/src/io.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/io.rs b/crates/ui-egui/src/io.rs index 2183940dee..ea27320b52 100644 --- a/crates/ui-egui/src/io.rs +++ b/crates/ui-egui/src/io.rs @@ -465,7 +465,10 @@ mod tests { assert_eq!(&written.borrow()[0].1[1..4], b"PNG"); app.run("document.exportSelection", json!({"path": "/tmp/sel2.png", "scale": 2})).unwrap(); assert_eq!(*asked.borrow(), 1, "a path writes without the save panel"); - assert_eq!(written.borrow().len(), 2); + let w = written.borrow(); + assert_eq!(w.len(), 2); + assert_eq!(w[0].0, "/tmp/sel.png", "the picked file"); + assert_eq!(w[1].0, "/tmp/sel2.png", "the given path"); } #[test]