test(lsp): add dedicated unit tests for rename dispatch helpers (plan 2606241814) - #699
Merged
Conversation
… 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 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:
|
…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
Owner
Author
|
🟢 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. |
Owner
Author
|
🔵 Merge Queue — CI running Merged into batch branch Next: No action needed — you'll be notified when CI completes. |
Owner
Author
|
✅ Merge Queue — merged This PR landed on Next: Done — nothing more to do here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TestServer_PrepareRenameAtcovering the heading, refDef, refUse, and prose-only dispatch arms ofprepareRenameAtdirectly (no wire overhead)TestServer_RenameHeadingcovering the happy path (cross-file anchor rewrite), collision rejection, and invalid-slug rejectionTestServer_RenameLinkRefcovering the happy path, whitespace-only label, and label-collision error pathsTestLspRenameWorkspace_Resolvecovering the open-buffer path (returns client URI) and the disk-fallback pathlspRenameWorkspace.Resolvenow that it has a direct test; the exemption comments onIncomingAnchorEdgesandFiles(trivial one-liners) were already presentTest plan
go test ./internal/lsp/... -run "TestServer_PrepareRenameAt|TestServer_RenameHeading|TestServer_RenameLinkRef|TestLspRenameWorkspace_Resolve"— all 10 subtests greengo test ./...— no failuresmdsmith check .— 516 files, 0 failures🤖 Generated with Claude Code
https://claude.ai/code/session_01FHM3UZkRpuAptJ635qpEqp
Generated by Claude Code