From 2047379cab28e641093ac4936b5707b54e1f4cc2 Mon Sep 17 00:00:00 2001 From: jedarden Date: Mon, 6 Jul 2026 20:40:20 -0400 Subject: [PATCH] docs(bf-5dopl): add verification note Documents the assertion message update work performed and test results. --- notes/bf-5dopl.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 notes/bf-5dopl.md diff --git a/notes/bf-5dopl.md b/notes/bf-5dopl.md new file mode 100644 index 0000000..ed3a284 --- /dev/null +++ b/notes/bf-5dopl.md @@ -0,0 +1,69 @@ +# Bead bf-5dopl Verification Note + +**Task:** Rewrite unmapped glyph assertions in test files +**Date:** 2026-07-06 +**Commit:** 9c0f18c1 + +## Summary + +Completed the task of applying newly designed assertion messages to unmapped glyph test code. + +## Work Performed + +### Files Examined +1. `crates/pdftract-core/src/font/unmapped.rs` - 9 assertions +2. `crates/pdftract-core/src/font/encoding.rs` - 63 assertions +3. `crates/pdftract-core/src/font/resolver.rs` - 1 assertion +4. `crates/pdftract-core/tests/cmap_unmapped_glyphs.rs` - multiple assertions +5. `crates/pdftract-core/tests/unmapped_glyph_names_config.rs` - multiple assertions + +### Finding +All unmapped glyph assertions except one were already updated with the new message format from parent bead bf-w1o10. The new format follows the template: +``` +". \ +Expected: . \ +Found: . \ +Why this matters: ." +``` + +### Change Made +**File:** `crates/pdftract-core/src/font/resolver.rs` +**Test:** `test_resolve_level2_unmapped_code` (line 868-874) + +**Before:** +```rust +assert!(result.is_failure()); +``` + +**After:** +```rust +assert!( + result.is_failure(), + "Level 2 resolution should fail for unmapped character codes. \ + Expected: result.is_failure() == true. \ + Found: false. \ + Why this matters: Most codes in StandardEncoding above 0x7F are unmapped and should fail Level 2 (encoding + AGL) resolution per build/unmapped-glyph-names.json filtering." +); +``` + +## Acceptance Criteria + +- ✅ All unmapped glyph assertions updated with new messages +- ✅ No generic 'assertion failed' messages remain in unmapped glyph tests +- ✅ Assertion logic unchanged (only messages improved) +- ✅ Each test file committed separately with descriptive commit message + +## Test Results + +All unmapped glyph tests pass: +- `font::unmapped::tests` - 3/3 tests pass +- `font::encoding::tests::test_differences*` - 11/11 tests pass +- `font::resolver::tests::test_resolve_level2_unmapped_code` - 1/1 test passes +- `cmap_unmapped_glyphs` - 7/7 tests pass +- `unmapped_glyph_names_config` - 4/4 tests pass + +## References + +- Parent bead: bf-w1o10 (message design) +- Inventory: notes/bf-4kbre-inventory.md +- Message template: notes/bf-lpyhe-template.md