From 586246d69aea65814bbdd83d43fb6dc61f5d992e Mon Sep 17 00:00:00 2001 From: oracola91 <118899664+oracola91@users.noreply.github.com> Date: Tue, 20 Oct 2026 11:23:29 +0300 Subject: [PATCH] organize: check the page's own MediaBox values in the walk test The root's MediaBox and the page's own both have four numbers, so the length check passed even if the page lost its own value. Compare the values instead. --- crates/organize/src/tests.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/organize/src/tests.rs b/crates/organize/src/tests.rs index 4f681367dd..224863af14 100644 --- a/crates/organize/src/tests.rs +++ b/crates/organize/src/tests.rs @@ -2840,7 +2840,8 @@ fn page_walk_skips_repeated_and_cyclic_kids_without_copying_attributes() { assert_eq!(attrs.get(b"Rotate").and_then(Object::as_int), Some(90), "Rotate from the root"); assert_eq!(walk.next().map(|(p, _)| p), Some(second)); let (_, last) = walk.next().unwrap(); - assert_eq!(last.get(b"MediaBox").and_then(Object::as_array).map(Vec::len), Some(4), "own MediaBox kept"); + let media_box = last.get(b"MediaBox").and_then(Object::as_array).map(|m| m.iter().filter_map(Object::as_int).collect::>()); + assert_eq!(media_box, Some(vec![0, 0, 500, 500]), "own MediaBox kept over the root's"); assert!(walk.next().is_none()); assert_eq!(labels(&doc), ["Page 1", "Page 2", "Page 3"]); }