PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust
test(ui): the narrow-box tests check the text reaches the box's right edge
RiceDee950715da0dd3
diff --git a/crates/ui-egui/tests/it/content.rs b/crates/ui-egui/tests/it/content.rsindex add686846..619352b8f 100644--- a/crates/ui-egui/tests/it/content.rs+++ b/crates/ui-egui/tests/it/content.rs@@ -756,8 +756,12 @@ fn the_text_editor_aligns_a_narrow_box_to_its_own_edge() {assert!(r.width() < 60.0, "the box is narrower than the editor: {}", r.width());let pixels = h.render().unwrap();let inside = ink(&pixels, r);+ let edge = ink(&pixels, egui::Rect::from_min_max(pos2(r.right() - r.width() * 0.25, r.min.y), r.max));let past = ink(&pixels, egui::Rect::from_min_max(pos2(r.right() + 2.0, r.min.y), pos2(r.right() + 40.0, r.max.y)));- assert!(inside > 20 && past == 0, "the text is drawn in its box ({inside} dark pixels in it, {past} past its right edge)");+ assert!(+ inside > 20 && edge > 0 && past == 0,+ "the text is drawn in its box, up to its right edge ({inside} dark pixels in it, {edge} in its last quarter, {past} past it)"+ );}fn mode_tab(h: &Harness<'static, PdfCraftApp>, label: &str) -> egui::Rect {