test: close corpus coverage gaps and make fixtures self-describing - #192
Merged
Conversation
…aries Typora-derived HTML fixtures stay in commonmark/html.md rather than moving to extensions/. Every tag Typora documents is already CommonMark raw HTML, so filing them as deliberately nonstandard syntax would assert something false about standard syntax. Displaying raw HTML as literal text also collapses the per-tag rendering distinctions into one behavior, so the new fixtures are framed by block condition and end condition instead of by tag. The [reference] label in interactions.md was defined twice. The second section resolved through the first definition and so demonstrated the opposite of its heading. fenced-diagrams.md is dropped. Its entire content is one fenced block with an info string, already covered by commonmark/code.md, and diagram rendering is outside the supported set.
Most of the corpus already writes the expected behavior into the fixture content, as in `*asterisk opens but underscore closes_`. The sections that used alpha/foo/A-B placeholders instead left a reader deriving from the specification which of several cases under one heading did what. Recording the convention in the README needs a line separating it from the existing rule against embedded expected HTML and parser assertions. Naming a delimiter outcome in prose is a description a manual tester compares the rendering against, not machine-checked output. The "Rule of three" heading named a specification rule rather than the behavior under inspection, and named the wrong rule for the cases beneath it.
Azganoth
enabled auto-merge (squash)
August 11, 2026 04:59
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
Audited
corpus/against CommonMark 0.31.2, the GFM extension sections, and Typora's documented HTML support, then closed the gaps the audit found.Coverage:
<script>,<style>, and<!--but ends<section>and<details>; closing tag as block start; multi-line, unquoted, and single-quoted attributes; mismatched inline tags; event-handler attributes.practical/round-trip.mdfor serialization normalization, including the delimiter-only, destination-only, title-only, and partial-reference selections named in the specification.javascript:anddata:in autolink, inline-link, and image position; an entity-obfuscated scheme; raw-HTMLimg/video/audio/iframe/embedrelative sources.Cuts:
stress.md, already identical to the one incommonmark/text-and-breaks.md.extensions/fenced-diagrams.md, whose entire content is one fenced block with an info string thatcommonmark/code.mdalready covers.[reference]label collision between two sections ofinteractions.md, where the second section resolved through the first definition and demonstrated the opposite of its heading.Convention:
corpus/README.md, with a line separating it from the existing prohibition on embedded expected HTML and parser assertions.Typora-derived HTML content stays in
commonmark/html.mdrather than moving toextensions/. Every tag Typora documents is already CommonMark raw HTML, so filing it as deliberately nonstandard syntax would assert something false about standard syntax. Because the app displays raw HTML as literal text, the per-tag rendering distinctions collapse into one behavior, so the new fixtures are framed by block condition and end condition instead of by tag. Thevideo/audio/iframeembeds are the exception and went toenvironment/asset-handoff.md, where local-resource resolution is already covered.Related Issue
Not applicable.
Verification
No automated test references
corpus/, sopnpm checkis unaffected by this change.Targeted validation:
corpus/boundaries/bytes/invalid-utf8.mdstill contains the raw0xFFbyte after staging and after the pre-commit hook, confirmed withod -cagainst both the working tree and the staged blob.corpus/commonmark/text-and-breaks.mdand the two trailing spaces at the end of its adjacent paragraph survive the pre-commit hook, confirmed withcat -A.oxfmtmatches zero Markdown files, so lint-staged cannot rewrite the whitespace- and byte-sensitive fixtures.corpus/boundaries/limits/long-line.mdholds lines of 22499, 5000, and 2012 characters.Not verified: none of the new fixtures were opened in the running app. The CommonMark outcomes written into the rewritten emphasis fixtures were derived by hand rather than checked against a reference implementation.
Notes
The audit's rejected proposals are deliberate omissions rather than oversights: per-tag fixtures for the inline tags Typora documents,
<pre>and<textarea>block fixtures, the emphasis multiple-of-three cases, and acorpus/security/directory. The last one would sort fixtures by threat model while every other directory sorts by defining specification, and would require duplicating content to keep either axis complete.Two proposed cuts were dropped on a second look.
boundaries/bytes/delete.mdandunit-separator.mdexercise one CommonMark decision between them but may diverge in a text-shaping layer, and trimming the length-2 cases from the opening-only backtick section removes coverage to save four lines.