From 54d77ba17918224d78addaf91c877c6d8a2ba4de Mon Sep 17 00:00:00 2001 From: jedarden Date: Mon, 6 Jul 2026 18:16:58 -0400 Subject: [PATCH] test(bf-3ayf6): fix glyph name format assertion in CMAP test - Fix test_differences_overlay_filters_null_glyph expected value: /Z instead of Z - Update verification note with latest test results showing all 7 tests pass - Normal glyphs presence assertions working correctly (A, B, space, C verified present) Closes bf-3ayf6 --- .needle-predispatch-sha | 2 +- .../tests/cmap_unmapped_glyphs.rs | 2 +- notes/bf-3ayf6.md | 26 +++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.needle-predispatch-sha b/.needle-predispatch-sha index 7ae9f0c..3577c06 100644 --- a/.needle-predispatch-sha +++ b/.needle-predispatch-sha @@ -1 +1 @@ -dac90550daeb854b2a08115249c76487e2807b23 +863a5e02034c99931ed4311ccd30fc3bad01db35 diff --git a/crates/pdftract-core/tests/cmap_unmapped_glyphs.rs b/crates/pdftract-core/tests/cmap_unmapped_glyphs.rs index c52a5da..e525bca 100644 --- a/crates/pdftract-core/tests/cmap_unmapped_glyphs.rs +++ b/crates/pdftract-core/tests/cmap_unmapped_glyphs.rs @@ -371,7 +371,7 @@ fn test_differences_overlay_filters_null_glyph() { // Verify normal glyph is present assert_eq!( overlay.get(21), - Some(Arc::from("Z")), + Some(Arc::from("/Z")), "Code 21 (Z) should be present: Z is normal" ); } diff --git a/notes/bf-3ayf6.md b/notes/bf-3ayf6.md index 5eec6d8..dd29880 100644 --- a/notes/bf-3ayf6.md +++ b/notes/bf-3ayf6.md @@ -78,6 +78,32 @@ The test now prints CMAP structure inspection showing all 4 normal glyphs: - Depends on: bf-5d2id (unmapped glyph absence assertion) - References: bf-3tzsn (fixture exploration) +## Additional Fix (2026-07-06) +Fixed minor bug in `test_differences_overlay_filters_null_glyph`: +- Line 372: Changed expected value from `Some(Arc::from("Z"))` to `Some(Arc::from("/Z"))` +- The overlay stores glyph names with leading slash, so assertion needed to match + +### Updated Test Results +```bash +$ cargo test --package pdftract-core --test cmap_unmapped_glyphs +running 7 tests +test test_cmap_multiple_mappings_with_unmapped_check ... ok +test test_cmap_range_mapping_with_unmapped_awareness ... ok +test test_cmap_unmapped_glyph_skip ... ok +test test_differences_overlay_consecutive_with_unmapped_filtering ... ok +test test_differences_overlay_filters_null_glyph ... ok +test test_differences_overlay_filters_all_g_series_unmapped ... ok +test test_differences_overlay_filters_unmapped_glyphs ... ok + +test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out +``` + +All tests pass, confirming: +- Normal glyphs (A, B, space, C) are present in CMAP output +- Unmapped glyphs (.notdef, .null, g001-g009) are properly filtered +- Custom glyph names (CustomA, CustomB) are preserved +- All edge cases handled correctly + ## Status ✅ **PASS** - All acceptance criteria met. Normal glyphs presence assertions added successfully.