Skip to content

Golden corpus hardening: baseline status annotations and parser-contract coverage #505

Description

@schuyler

Context

The golden corpus (MacDownTests/Fixtures/, 31 fixtures, consumed by MPMarkdownRenderingTests.m, MPSyntaxHighlightingTests.m, MPMathJaxRenderingTests.m) is the safety net for both the cmark-gfm swap (v3000.1.1) and the Swift port (v3001.0.0). Two gaps stand between it and that role. From the ground survey (plans/dependency-overhaul-survey.md §6.2 on branch claude/dependencies-overhaul-planning-hw3lms) and decision register D-1/D-3/D-4.

Part 1 — Baseline status annotations (D-1)

The corpus faithfully snapshots hoedown's bugs: #26 (list numbering), #27 (merged blockquotes), #10 (code indentation) are expected to close as side effects of cmark-gfm. With plain XCTAssertEqualObjects, the parser swap will "fail" tests by fixing bugs, and a blind regenerate would stamp over intentional deviations.

Add a sidecar manifest (Fixtures/manifest.json) tagging every fixture:

  • matches-spec — output is CommonMark/GFM-correct; must survive the swap byte-identical (or with reviewed formatting-only diffs)
  • known-hoedown-bug — output is wrong today; the swap is expected to change it (link the issue)
  • intentional-macdown-deviation — MacDown deliberately differs from GFM; must survive the swap

A sidecar beats renaming files: the loader (MPMarkdownRenderingTests.m:59) stays untouched. Enumerate the third category now, while the knowledge is fresh — it is the migration's most fragile knowledge.

Part 2 — Parser-contract coverage (D-3)

Add fixtures for every contract surface in survey §2.12 not currently covered:

Non-goal

A rendered-DOM/visual corpus is deliberately not part of this issue — that belongs to the WKWebView milestone (#111), where the web view is the variable under test (D-4: two corpora, one variable each).

References

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions