pdftract/crates/pdftract-core/src/parser
jedarden b72d8312ce test(pdftract-57o4): add ParentTree integration tests for annotation and sparse arrays
Add two comprehensive integration tests to validate the ParentTree resolver:

1. test_parent_tree_annotation_with_struct_parent:
   - Creates a body paragraph StructElem
   - Creates ParentTree with page array (MCID 0 -> body, MCID 1 -> orphan/null)
   - Creates ParentTree with annotation entry (key 100 -> body)
   - Verifies MCID resolution returns correct map and orphans
   - Verifies annotation /StructParent resolution returns the body ref
   - Verifies the referenced StructElem is in the tree

2. test_parent_tree_off_by_one_missing_entries:
   - Creates ParentTree with sparse array (only 3 entries for potentially more MCIDs)
   - Verifies non-null entries are correctly mapped
   - Verifies null entries are recorded as orphans
   - Documents that MCIDs beyond array length would be detected in Phase 7.1.4

Also export ParentTreeResolver and ParentTreeEntry from parser module
for use by the block builder in Phase 7.1.4.

All 67 struct_tree tests pass (18 ParentTree-specific tests).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 18:36:09 -04:00
..
lexer feat(pdftract-29z7b): implement unified diagnostic system + CLI commands 2026-05-22 22:38:31 -04:00
object feat(pdftract-29z7b): implement unified diagnostic system + CLI commands 2026-05-22 22:38:31 -04:00
catalog.rs feat(pdftract-29z7b): implement unified diagnostic system + CLI commands 2026-05-22 22:38:31 -04:00
diagnostic.rs docs(pdftract-49f8): establish Cargo.lock policy and documentation 2026-05-20 18:13:14 -04:00
mod.rs test(pdftract-57o4): add ParentTree integration tests for annotation and sparse arrays 2026-05-23 18:36:09 -04:00
objstm.rs fix(pdftract-2a6rk): fix xref.rs u64 literal overflow in proptest 2026-05-22 17:26:27 -04:00
ocg.rs fix(pdftract-2a6rk): fix xref.rs u64 literal overflow in proptest 2026-05-22 17:26:27 -04:00
outline.rs feat(pdftract-29z7b): implement unified diagnostic system + CLI commands 2026-05-22 22:38:31 -04:00
pages.rs feat(pdftract-bf-2y2rp): implement lazy stream decoding for PDF extraction 2026-05-23 12:30:26 -04:00
resources.rs fix(pdftract-2a6rk): fix xref.rs u64 literal overflow in proptest 2026-05-22 17:26:27 -04:00
secrets.rs feat(pdftract-59zz): implement MCP bearer token ingress channels and TH-03 enforcement 2026-05-18 02:47:54 -04:00
stream.rs test(bf-21hw8): add bounded predictor tests for PNG and TIFF 2026-05-23 13:35:57 -04:00
struct_tree.rs test(pdftract-57o4): add ParentTree integration tests for annotation and sparse arrays 2026-05-23 18:36:09 -04:00
xref.rs feat(pdftract-29z7b): implement unified diagnostic system + CLI commands 2026-05-22 22:38:31 -04:00