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> |
||
|---|---|---|
| .. | ||
| pdftract-cer-diff | ||
| pdftract-cli | ||
| pdftract-core | ||
| pdftract-libpdftract | ||
| pdftract-py | ||