test(inline_scan): add dedicated unit tests for 12 unexported helpers - #686
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
9d40f39 to
865919b
Compare
|
🟢 Merge Queue — picked up This PR is in the queue and will be batched with other Next: No action needed — you'll get another comment when CI starts on the batch. View merge queue run. |
|
🔵 Merge Queue — CI running Merged into batch branch Next: No action needed — you'll be notified when CI completes. |
|
❌ Merge Queue — CI failed The batch CI run failed with this PR in it. Next: Fix the failure, push updates, then re-add the |
Satisfies audit policy (every function has a named test) for internal/lint/inline_scan.go. Adds TestScanRunEligible, TestMergeAppendText, TestFinalAppendText, TestScanParagraphInlines, TestApplyCodeSpan, TestApplyAutolink, TestApplyBang, TestApplyLink, TestScanCodeSpan, TestScanLinkOrImage, TestScanLinkParens, and TestSkipSpacesAt. isSpaceOrNewlineByte is exempt (trivial one-liner, no test by design comment added). Also records the 2026-06-23 architecture audit in architecture-audit.md, filing two new plans (2606231013 and 2606231014) for the tax items found. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GYs45JNFoMgto6dk5mSSXb
…omment The predicate has two boolean branches (c==' ' and c=='\n') so it does not qualify for the trivial-accessor exemption in the audit policy. Replace the comment with a 3-case unit test and update the plan AC. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GYs45JNFoMgto6dk5mSSXb
- TestScanCodeSpan: add *ast.CodeSpan type assertion for the double- backtick case (the single-backtick case had it; the double-backtick case was missing it) - TestScanLinkOrImage: capture and assert after==11 for the image path (was discarded with _; the link path already asserted it) - TestApplyBang: assert para.FirstChild()!=nil after the "! without [" flush, verifying that mergeAppendText actually appended the text node Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GYs45JNFoMgto6dk5mSSXb
Task 4 said to add an exemption comment for isSpaceOrNewlineByte. In practice we added TestIsSpaceOrNewlineByte because the predicate has two boolean branches and the trivial-accessor exemption doesn't apply. Update the task text to match what was done. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GYs45JNFoMgto6dk5mSSXb
865919b to
abf2463
Compare
|
🟢 Merge Queue — picked up This PR is in the queue and will be batched with other Next: No action needed — you'll get another comment when CI starts on the batch. View merge queue run. |
|
🔵 Merge Queue — CI running Merged into batch branch Next: No action needed — you'll be notified when CI completes. |
|
✅ Merge Queue — merged This PR landed on Next: Done — nothing more to do here. |
Summary
internal/lint/inline_scan.go, satisfying the audit policy (every function has aTestFooby name)// no test by design: trivial one-liner with no branch.exemption comment forisSpaceOrNewlineBytedocs/development/architecture-audit.md, filing two new tax plans (2606231013 ✅ and 2606231014 🔲)Closes plan
2606231013_arch-fix-inline-scan-helper-tests.Test plan
go test ./internal/lint/... -run "TestScanRunEligible|TestMergeAppendText|TestFinalAppendText|TestScanParagraphInlines|TestApplyCodeSpan|TestApplyAutolink|TestApplyBang|TestApplyLink|TestScanCodeSpan|TestScanLinkOrImage|TestScanLinkParens|TestSkipSpacesAt"— all 12 passgo test ./internal/lint/...— full package greengo vet ./internal/lint/...— cleango run ./cmd/mdsmith check .— no markdown lint failures🤖 Generated with Claude Code
https://claude.ai/code/session_01GYs45JNFoMgto6dk5mSSXb
Generated by Claude Code