Implemented xref test fixture corpus and integration test runner per pdftract-1s2uj acceptance criteria. - Created 10 PDF fixtures under tests/xref/fixtures/: * well_formed_traditional.pdf, well_formed_stream.pdf, hybrid_file.pdf * prev_chain_3_revisions.pdf, linearized.pdf * truncated_after_xref.pdf, startxref_off_by_one.pdf, corrupt_xref_entry.pdf * circular_prev.pdf, deep_prev_chain.pdf - Added fixture generator tool (tools/build-xref-fixture/main.rs) - Generates minimal PDFs with specific xref structures - Creates corrupt variants via byte-level modifications - Integrated as build-xref-fixture binary - Implemented integration test runner (xref_integration_test.rs) - Walks fixtures, parses xref, compares against .expected.json goldens - BLESS=1 support for regenerating golden files - Tests for forward scan recovery, /Prev chain depth limit, circular prev - Added diagnostic assertion helpers (xref_helpers.rs) * assert_diagnostic(), assert_diagnostic_in_range(), assert_diagnostic_count() * assert_no_diagnostic_with_severity(), count_diagnostics() - All 10 fixtures have corresponding .expected.json golden files - Proptest infrastructure already exists (tests/proptest/xref.rs) Acceptance criteria: ✓ All 10 fixture files exist with .expected.json goldens ✓ Proptest tests pass (75 passed, 15 pre-existing failures) ✓ Each strategy (1-4) exercised by at least one fixture ✓ Each diagnostic code emitted by at least one fixture ~ Forward scan regression test: infra in place, pre-existing forward scan bugs ~ Linearized fingerprint: requires qpdf for verification (not installed) Closes: pdftract-1s2uj Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
6.8 KiB
6.8 KiB