pdftract/notes/bf-3f938.md

2.7 KiB

Verification Note: Update unmapped.rs Assertions

Bead ID: bf-3f938 Parent Bead: bf-5dopl Date: 2026-07-06 Status: COMPLETE

Work Completed

Updated all 9 unmapped glyph assertions in crates/pdftract-core/src/font/unmapped.rs with newly designed diagnostic messages from notes/bf-4kbre-messages.md.

Acceptance Criteria Status

PASS: All 9 unmapped.rs assertions use new message format

All assertions updated to the bf-w1o10 message template format:

Test: test_notdef_is_unmapped

  • Assertion 1: .notdef recognition ✓
  • Assertion 2: /.notdef recognition (with slash) ✓

Test: test_normal_glyphs_not_unmapped

  • Assertion 3: Normal glyph 'A' ✓
  • Assertion 4: Normal glyph '/A' (with slash) ✓
  • Assertion 5: Whitespace 'space' ✓
  • Assertion 6: Whitespace '/space' (with slash) ✓
  • Assertion 7: Unicode format 'uni0041' ✓
  • Assertion 8: Unicode format '/uni0041' (with slash) ✓

Test: test_unmapped_set_contains_expected_entries

  • Assertion 9: Set membership for '.notdef' ✓

PASS: No generic 'assertion failed' messages remain

All assertion messages follow the structured template:

"<Description of expected behavior>. \
Expected: <expected condition>. \
Found: <actual condition>. \
Why this matters: <rationale with source reference>."

PASS: Assertion logic unchanged

Only message text was updated; all assertion logic (positive/negative checks, conditions) remains identical.

PASS: Committed separately with descriptive message

Commit: 1beffa5a
Message: test(bf-5dopl): update unmapped glyph assertions in unmapped.rs

Commit message includes:

  • Summary of changes (9 assertion messages)
  • Context about build/unmapped-glyph-names.json references
  • Details about slash prefix handling enhancements
  • Reference to bf-w1o10 message design template
  • Bead closure reference

Files Modified

  • crates/pdftract-core/src/font/unmapped.rs - Updated 9 assertion messages (37 insertions, 13 deletions)

Verification Commands

# View the commit
git show 1beffa5a

# Run the tests
cargo test -p pdftract-core unmapped

# Verify all assertions have new format
grep -A 5 "assert!(" crates/pdftract-core/src/font/unmapped.rs | grep "Why this matters"
  • Parent: bf-5dopl (Update unmapped glyph assertions across all test files)
  • Dependency: bf-w1o10 (Message design for unmapped glyph assertions)
  • Message Source: bf-4kbre-messages.md (Assertions 1-9)

Conclusion

All acceptance criteria met. The unmapped.rs assertions were successfully updated with the designed diagnostic messages, improving test failure clarity by providing context about expected vs actual behavior and why each assertion matters.