pdftract/crates
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
..
pdftract-cer-diff docs(pdftract-aawrz): add LICENSE-MIT and LICENSE-APACHE files 2026-05-23 10:36:28 -04:00
pdftract-cli feat(pdftract-4my): implement serve mode integration for full-render feature 2026-05-23 16:28:08 -04:00
pdftract-core test(pdftract-57o4): add ParentTree integration tests for annotation and sparse arrays 2026-05-23 18:36:09 -04:00
pdftract-libpdftract feat(pdftract-juc): implement Standard 14 font metrics registry 2026-05-23 14:04:02 -04:00
pdftract-py docs(pdftract-aawrz): add LICENSE-MIT and LICENSE-APACHE files 2026-05-23 10:36:28 -04:00