Skip to content

test(inline_scan): add dedicated unit tests for 12 unexported helpers - #686

Merged
jeduden merged 4 commits into
mainfrom
claude/youthful-knuth-daq23c
Jun 23, 2026
Merged

test(inline_scan): add dedicated unit tests for 12 unexported helpers#686
jeduden merged 4 commits into
mainfrom
claude/youthful-knuth-daq23c

Conversation

@jeduden

@jeduden jeduden commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds 12 named unit tests for the unexported helper functions in internal/lint/inline_scan.go, satisfying the audit policy (every function has a TestFoo by name)
  • Adds a // no test by design: trivial one-liner with no branch. exemption comment for isSpaceOrNewlineByte
  • Records the 2026-06-23 architecture audit in docs/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 pass
  • go test ./internal/lint/... — full package green
  • go vet ./internal/lint/... — clean
  • go run ./cmd/mdsmith check . — no markdown lint failures

🤖 Generated with Claude Code

https://claude.ai/code/session_01GYs45JNFoMgto6dk5mSSXb


Generated by Claude Code

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.62%. Comparing base (10d2692) to head (abf2463).

Additional details and impacted files
Components Coverage Δ
Go 98.61% <ø> (ø)
TypeScript 99.54% <ø> (ø)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jeduden jeduden added the queue Add to a PR to enqueue it label Jun 23, 2026
@jeduden
jeduden force-pushed the claude/youthful-knuth-daq23c branch from 9d40f39 to 865919b Compare June 23, 2026 20:32
@jeduden jeduden added queue:active Applied automatically when a PR is in an active batch and removed queue Add to a PR to enqueue it labels Jun 23, 2026
@jeduden

jeduden commented Jun 23, 2026

Copy link
Copy Markdown
Owner Author

🟢 Merge Queue — picked up

This PR is in the queue and will be batched with other queue-labelled PRs.

Next: No action needed — you'll get another comment when CI starts on the batch. View merge queue run.

jeduden pushed a commit that referenced this pull request Jun 23, 2026
@jeduden

jeduden commented Jun 23, 2026

Copy link
Copy Markdown
Owner Author

🔵 Merge Queue — CI running

Merged into batch branch merge-queue/batch-686-1782246962. View CI run.

Next: No action needed — you'll be notified when CI completes.

@jeduden jeduden added queue:failed Applied automatically when CI fails or merge conflict occurs and removed queue:active Applied automatically when a PR is in an active batch labels Jun 23, 2026
@jeduden

jeduden commented Jun 23, 2026

Copy link
Copy Markdown
Owner Author

Merge Queue — CI failed

The batch CI run failed with this PR in it.

Next: Fix the failure, push updates, then re-add the queue label to retry.

claude added 4 commits June 23, 2026 20:47
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
@jeduden
jeduden force-pushed the claude/youthful-knuth-daq23c branch from 865919b to abf2463 Compare June 23, 2026 20:47
@jeduden jeduden added queue Add to a PR to enqueue it and removed queue:failed Applied automatically when CI fails or merge conflict occurs labels Jun 23, 2026 — with Claude
@jeduden jeduden added queue:active Applied automatically when a PR is in an active batch and removed queue Add to a PR to enqueue it labels Jun 23, 2026
@jeduden

jeduden commented Jun 23, 2026

Copy link
Copy Markdown
Owner Author

🟢 Merge Queue — picked up

This PR is in the queue and will be batched with other queue-labelled PRs.

Next: No action needed — you'll get another comment when CI starts on the batch. View merge queue run.

@jeduden

jeduden commented Jun 23, 2026

Copy link
Copy Markdown
Owner Author

🔵 Merge Queue — CI running

Merged into batch branch merge-queue/batch-686-1782247688. View CI run.

Next: No action needed — you'll be notified when CI completes.

@jeduden jeduden removed the queue:active Applied automatically when a PR is in an active batch label Jun 23, 2026
@jeduden
jeduden merged commit 02cac29 into main Jun 23, 2026
36 checks passed
@jeduden

jeduden commented Jun 23, 2026

Copy link
Copy Markdown
Owner Author

Merge Queue — merged

This PR landed on main via commit 02cac29. CI run that validated the merge.

Next: Done — nothing more to do here.

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.

2 participants