From e6b28f0e802824d5dc9f585c196a4f3406203786 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Fri, 16 Oct 2026 04:31:29 +0700 Subject: [PATCH] Tests: read the PDF/X output intent's profile with the crate's own xref reader (#1962) --- crates/pdf/src/tests_pdfx.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/pdf/src/tests_pdfx.rs b/crates/pdf/src/tests_pdfx.rs index 8149839c6..400662b76 100644 --- a/crates/pdf/src/tests_pdfx.rs +++ b/crates/pdf/src/tests_pdfx.rs @@ -59,9 +59,8 @@ fn each_standard_writes_its_header_output_intent_boxes_and_identification() { } // (PDF/X-3 and PDF/X-4 share the stream of the profile that tags the colours.) let oi: u32 = t.split("/DestOutputProfile ").nth(1).unwrap().split(' ').next().unwrap().parse().unwrap(); - let file = hayro_syntax::Pdf::new(std::sync::Arc::new(r.bytes.clone())).unwrap(); - let profile = file.xref().get::>(hayro_syntax::object::ObjectIdentifier::new(oi as i32, 0)).unwrap(); - assert_eq!(profile.dict().get::(b"N"), Some(4), "{standard:?}: a CMYK profile"); + let (start, end) = crate::patch::Xref::read(&r.bytes).unwrap().dict(&r.bytes, oi).unwrap(); + assert!(text(&r.bytes[start..end]).contains("/N 4"), "{standard:?}: a CMYK profile"); // Every page is trimmed to its artboard; the file is untrapped, titled and dated. for want in ["/TrimBox[0 0 200 100]", "/Trapped/False", "/Title(Untitled)", "/CreationDate", "/ModDate"] { assert!(t.contains(want), "{standard:?}: {want}");