Skip to content

test(lsp): add dedicated unit tests for rename dispatch helpers (plan 2606241814) - #699

Merged
jeduden merged 3 commits into
mainfrom
claude/youthful-knuth-7fevq1
Jun 25, 2026
Merged

test(lsp): add dedicated unit tests for rename dispatch helpers (plan 2606241814)#699
jeduden merged 3 commits into
mainfrom
claude/youthful-knuth-7fevq1

Conversation

@jeduden

@jeduden jeduden commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds TestServer_PrepareRenameAt covering the heading, refDef, refUse, and prose-only dispatch arms of prepareRenameAt directly (no wire overhead)
  • Adds TestServer_RenameHeading covering the happy path (cross-file anchor rewrite), collision rejection, and invalid-slug rejection
  • Adds TestServer_RenameLinkRef covering the happy path, whitespace-only label, and label-collision error paths
  • Adds TestLspRenameWorkspace_Resolve covering the open-buffer path (returns client URI) and the disk-fallback path
  • Removes the stale "no test by design" comment from lspRenameWorkspace.Resolve now that it has a direct test; the exemption comments on IncomingAnchorEdges and Files (trivial one-liners) were already present

Test plan

  • go test ./internal/lsp/... -run "TestServer_PrepareRenameAt|TestServer_RenameHeading|TestServer_RenameLinkRef|TestLspRenameWorkspace_Resolve" — all 10 subtests green
  • go test ./... — no failures
  • mdsmith check . — 516 files, 0 failures

🤖 Generated with Claude Code

https://claude.ai/code/session_01FHM3UZkRpuAptJ635qpEqp


Generated by Claude Code

… 2606241814)

Adds TestServer_PrepareRenameAt, TestServer_RenameHeading,
TestServer_RenameLinkRef, and TestLspRenameWorkspace_Resolve to
internal/lsp/rename_dispatch_test.go, covering every dispatch arm and
error path. Removes the stale "no test by design" comment from
lspRenameWorkspace.Resolve now that it has a direct test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FHM3UZkRpuAptJ635qpEqp
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.62%. Comparing base (e67ecc8) to head (56f12d8).

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.

claude added 2 commits June 25, 2026 22:21
…catalog

TestServer_RenameHeading was 90 lines, exceeding the 60-line funlen limit.
Extracted the three subtest bodies into named package-level helpers
(testRenameHeading_HappyPath, testRenameHeading_Collision,
testRenameHeading_InvalidSlug) so the top-level test function stays short.

Also regenerates PLAN.md catalog to reflect the updated status of plan 2606241814.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FHM3UZkRpuAptJ635qpEqp
…ames

Renamed testRenameHeading_HappyPath, testRenameHeading_Collision, and
testRenameHeading_InvalidSlug to camelCase per the revive linter's
var-naming rule (no underscores in non-Test function names).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FHM3UZkRpuAptJ635qpEqp
@jeduden jeduden added queue Add to a PR to enqueue it queue:active Applied automatically when a PR is in an active batch and removed queue Add to a PR to enqueue it labels Jun 25, 2026
@jeduden

jeduden commented Jun 25, 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 25, 2026

Copy link
Copy Markdown
Owner Author

🔵 Merge Queue — CI running

Merged into batch branch merge-queue/batch-699-1782429339. 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 25, 2026
@jeduden
jeduden merged commit e4692fc into main Jun 25, 2026
32 checks passed
@jeduden

jeduden commented Jun 25, 2026

Copy link
Copy Markdown
Owner Author

Merge Queue — merged

This PR landed on main via commit e4692fc. 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