Skip to content

chore: reorganize fixtures and harden heading PNG tests#11

Merged
rrbe merged 1 commit into
masterfrom
chore/reorganize-fixtures
May 25, 2026
Merged

chore: reorganize fixtures and harden heading PNG tests#11
rrbe merged 1 commit into
masterfrom
chore/reorganize-fixtures

Conversation

@rrbe
Copy link
Copy Markdown
Owner

@rrbe rrbe commented May 25, 2026

Summary

  • Consolidate 7 overlapping markdown fixtures into 4 purpose-named ones; new fixtures/specialized/ subdir houses narrow single-purpose fixtures (headings basics, headings emoji, large stress)
  • Split the bundled heading PNG integration test into 4 focused assertions, and enforce display-form a=T on every emitted APC frame (the old check only looked for one occurrence in stdout, so a stray a=t would slip through and render blank in cat mode)
  • New headings-emoji.md fixture + emoji_headings_emit_decodable_nonblank_pngs test guards against emoji font fallback regressions silently producing blank glyphs
  • Add docs/TERMINAL_PROTOCOLS.md explaining the ANSI / Kitty graphics protocol layering, how fixtures/expected/*.ansi captures both, and how strip_kitty_images / extract_kitty_frames work

Fixture layout after this change

fixtures/
├── supported-syntax.md       # current + roadmap syntax (HTML, images, wrap-indent, metadata, TOC)
├── unsupported-syntax.md     # out-of-scope features only
├── links/                    # multi-file TUI link-nav fixture
├── specialized/              # narrow single-purpose fixtures
│   ├── headings-basic.md     # minimal H1/H2/H3 for PNG height test
│   ├── headings-emoji.md     # emoji + CJK headings, font-fallback regression guard
│   └── large.md              # ~15k-line stress fixture (regenerate with scripts/gen-large-fixture.sh)
└── expected/                 # snapshot baselines
    ├── supported-syntax.ansi
    └── unsupported-syntax.ansi

Snapshot baselines for the two consolidated fixtures were regenerated. TODO.md's "整理测试用的 markdown 文件" item is checked off.

Test plan

  • make check passes (fmt-check + clippy + tests, including the 4 new heading tests and 2 snapshot tests)
  • cargo run -- --cat fixtures/specialized/large.md exits cleanly on the stress fixture
  • cargo run -- --tui fixtures/links/index.md still navigates link-following correctly (manual)
  • cargo run -- --tui fixtures/supported-syntax.md renders all 12 sections without panic (manual)

🤖 Generated with Claude Code

Consolidate 7 overlapping markdown fixtures into 4 purpose-named ones,
add a `specialized/` subdir for narrow single-purpose fixtures, and
split the heading PNG integration test into 4 focused assertions.

Fixture layout:
- supported-syntax.md: one comprehensive fixture covering current +
  roadmap syntax (HTML, images, wrap-indent, metadata, TOC), replacing
  full-syntax / full-syntax-zh / tasklist / emoji-test / toc-test
- unsupported-syntax.md: trimmed to out-of-scope features only
- specialized/headings-basic.md: minimal H1/H2/H3 for PNG height test
- specialized/headings-emoji.md: emoji + CJK headings, guards against
  font fallback regressions silently rendering blank glyphs
- specialized/large.md: ~15k-line stress fixture from
  scripts/gen-large-fixture.sh
- links/: kept as multi-file TUI link-nav fixture

Heading test improvements (tests/headings.rs):
- Split the bundled test into 4 focused tests so failures point
  directly at the broken property
- Verify every APC frame's first-chunk header uses `a=T` display form,
  not just the first occurrence in stdout — a stray `a=t` in cat mode
  silently renders blank
- Add emoji_headings_emit_decodable_nonblank_pngs to catch emoji font
  fallback regressions

docs/TERMINAL_PROTOCOLS.md: reference for the ANSI / Kitty graphics
protocol layering, how fixtures/expected/*.ansi captures both, and
how strip_kitty_images / extract_kitty_frames work.

Snapshot baselines regenerated for the two consolidated fixtures.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rrbe rrbe merged commit 9609037 into master May 25, 2026
5 checks passed
@rrbe rrbe deleted the chore/reorganize-fixtures branch May 25, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant