docs(bf-5dopl): add verification note
Documents the assertion message update work performed and test results.
This commit is contained in:
parent
9c0f18c117
commit
2047379cab
1 changed files with 69 additions and 0 deletions
69
notes/bf-5dopl.md
Normal file
69
notes/bf-5dopl.md
Normal file
|
|
@ -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:
|
||||
```
|
||||
"<Description of expected behavior>. \
|
||||
Expected: <expected condition>. \
|
||||
Found: <actual condition>. \
|
||||
Why this matters: <rationale with source reference>."
|
||||
```
|
||||
|
||||
### 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
|
||||
Loading…
Add table
Reference in a new issue