Skip to content

test(css-contract): close the render→AFM_CLASSES loop#87

Open
P4suta wants to merge 1 commit into
mainfrom
test/class-contract-render-direction
Open

test(css-contract): close the render→AFM_CLASSES loop#87
P4suta wants to merge 1 commit into
mainfrom
test/class-contract-render-direction

Conversation

@P4suta

@P4suta P4suta commented Jun 16, 2026

Copy link
Copy Markdown
Owner

What

Adds the render-direction half of the afm CSS class contract in crates/afm-markdown/tests/css_class_contract.rs. The existing tests prove AFM_CLASSES ⊆ CSS; these close the loop construct → afm-* class → AFM_CLASSES:

  • every_rendered_class_is_recognised — every afm-* class a known construct emits is in AFM_CLASSES.
  • every_afm_class_is_exercised_by_the_corpus — every AFM_CLASSES entry is emitted by some construct (catches stale entries), modulo a documented UNEXERCISED allowlist.

Why

The pin-independent half of #74, and groundwork for the aozora feat/devex-inner-loop notation absorption (#81). On the next aozora pin bump, a new afm-* class — or one going stale on the DoubleRuby→AngleQuote rename — now fails by name instead of shipping silent unstyled markup. The heavier build.rs source-scrape that would eliminate the manual AFM_CLASSES append stays deferred in #74.

Notes

  • Corpus sources are copied verbatim from existing passing afm tests / aozora-render tests at the pinned SHA — none authored from memory.
  • The completeness test already surfaced two coverage gaps documented in UNEXERCISED: afm-indent (leaf indent has no source trigger; aozora-render exercises it only via a directly-constructed node) and afm-kaeriten (no afm-source trigger emits it at the current pin) — candidate follow-ups.

Verification

  • just test — 321/321 green
  • just lint — fmt-check / clippy -D warnings / typos / strict-code all clean

Part of #81. Implements the pin-independent half of #74.

🤖 Generated with Claude Code

The css_class_contract suite only proved AFM_CLASSES ⊆ CSS. Add the
render direction: render a curated corpus of every known aozora
construct through afm and assert (1) every emitted afm-* class is in
AFM_CLASSES, and (2) every AFM_CLASSES entry is emitted by some
construct (catching stale entries), modulo a documented UNEXERCISED
allowlist.

This is the pin-independent half of #74 and de-risks the upcoming
notation absorption (#81): a new upstream class — or a class going
stale on the DoubleRuby→AngleQuote pin bump — now fails by name
instead of shipping silent unstyled drift. The heavier build.rs
source-scrape stays deferred in #74.

Corpus sources are copied verbatim from existing passing afm tests
and aozora-render tests at the pinned SHA (none authored from memory).
The completeness test already surfaced two gaps — afm-indent (leaf)
and afm-kaeriten have no afm-source trigger at the current pin — both
documented in UNEXERCISED.

Part of #81.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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