You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expose NearestBlockAncestor, add byte-identical pin test, fill pyramid
Addresses the two remaining self-review concerns and aligns the
package's tests with the test-pyramid rule that every production
function ships its dedicated unit test by name.
Concern #2 — drop the nearestBlockAncestor duplicate:
- Expose NearestBlockAncestor from pkg/markdown/flavor so external
rewriters (and the rule adapter) share the helper instead of
duplicating it. Replace the rule's private copy in fix.go with
flavor.NearestBlockAncestor.
- Add it to the contract test, the markdown-library stable surface
list, and a dedicated TestNearestBlockAncestorPublic test.
Concern #3 — byte-identical pin test:
- pkg/markdown/flavor/detect_pin_test.go adds a corpus-driven table
test (pinCorpus) that maps each input to the exact Finding stream
(feature + 1-based line + 1-based column, in document order).
Plan 185 acceptance criterion "Table tests pin this" is now an
explicit gate; any subtle reorder, drop, or shift in MDS034
diagnostics will break the test with a side-by-side diff.
Test-pyramid alignment:
- TestNearestBlockAncestor (subtests for the skip-non-block and
orphan branches) plus TestNearestBlockAncestorPublic for the
exported wrapper.
- TestIsGitHubAlertPublic exercises both branches of IsGitHubAlert
(alert blockquote / heading-first-child).
- TestLineColPublic pins the documented 1-based semantics of the
exported LineCol wrapper.
- TestDualFindings covers the dualFindings helper I extracted from
Detect in the previous commit, asserting both the keep-filter and
the still-emits-other-features path.
Coverage in pkg/markdown/flavor stays at 100%; mdsmith check and
golangci-lint are clean.
https://claude.ai/code/session_0144ZKUS2Zrg7xBft54qyoti
0 commit comments