M6: a test pins that metadata without pdfaid:part declares no PDF/A

cargo-mutants found `==` turned to `!=` in declares_pdfa's search unpinned:
no case had metadata within the cap that declares nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
This commit is contained in:
Grzegorz MartensandClaude Opus 5.5 committed 2026-11-04 09:56:57 +01:00
1 parent 1cc810d440
commit 66415d7373
1 file changed
+5 -6
+5 -6
View File
@@ -3649,12 +3649,11 @@ fn page_shapes_decode_a_repeated_content_stream_within_the_budget() {
/// preflight reads it: a field drawn with characters its font lacks decodes no more than that. /// preflight reads it: a field drawn with characters its font lacks decodes no more than that.
#[test] #[test]
fn a_pdfa_declaration_is_read_from_metadata_within_its_cap() { fn a_pdfa_declaration_is_read_from_metadata_within_its_cap() {
let declared = |padding: usize| { let declared = |xmp: String| declares_pdfa(&document(&["<< /Type /Catalog /Metadata 2 0 R >>".into(), raw_stream(&xmp)]));
let xmp = format!("<x:xmpmeta><pdfaid:part>2</pdfaid:part>{}</x:xmpmeta>", " ".repeat(padding)); let pdfa = |padding: usize| format!("<x:xmpmeta><pdfaid:part>2</pdfaid:part>{}</x:xmpmeta>", " ".repeat(padding));
declares_pdfa(&document(&["<< /Type /Catalog /Metadata 2 0 R >>".into(), raw_stream(&xmp)])) assert!(declared(pdfa(1 << 20)));
}; assert!(!declared(pdfa(crate::appearances::MAX_XMP_BYTES)), "metadata past the cap declares nothing");
assert!(declared(1 << 20)); assert!(!declared("<x:xmpmeta><dc:title>pdfaid</dc:title></x:xmpmeta>".into()), "metadata without pdfaid:part declares nothing");
assert!(!declared(crate::appearances::MAX_XMP_BYTES), "metadata past the cap declares nothing");
} }
/// A widget listed many times, by one field's `/Kids` or by a `/Kids` array several fields share, /// A widget listed many times, by one field's `/Kids` or by a `/Kids` array several fields share,