test: add H1-H3 kitty PNG extraction integration test#10
Merged
Conversation
Covers TEST_PLAN.md Phase 2: extracts base64 PNG payloads from Kitty graphics APC frames in the binary's stdout, decodes them with the image crate, and asserts each heading level produces a non-empty, non-fully- transparent PNG whose pixel height matches the H1 > H2 > H3 font-size ordering.
- Extract tests/common/mod.rs with binary_path + run_termdown helper, used by both headings.rs and snapshots.rs. - Panic with a clear message when an APC frame is missing its ESC \ terminator, instead of silently feeding truncated bytes to base64. - Assert the display-form kitty header (\x1b_Gf=100,a=T) appears in stdout, guarding against regression to the a=t TUI-cache form. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fixtures/headings.md(one H1 + one H2 + one H3) andtests/headings.rsESC _ G … ; <chunk> ESC \), concatenatesm=1chunks, base64-decodes, and decodes the resulting PNG with theimagecratestyle.rsCovers TEST_PLAN.md Phase 2 (protocol detection + payload extraction + PNG decode + basic image-property asserts + level-size ordering). Phase 3 (pixel-level golden hashes) is intentionally still deferred until the heading font environment is stabilized.
Test plan
make checkpasses locally (73 unit + 9 cli + 5 snapshot + 1 new headings)