Skip to content

test(lsp/rename): add dedicated unit tests for 13 unexported helpers - #692

Merged
jeduden merged 4 commits into
mainfrom
claude/youthful-knuth-b3n5fk
Jun 24, 2026
Merged

test(lsp/rename): add dedicated unit tests for 13 unexported helpers#692
jeduden merged 4 commits into
mainfrom
claude/youthful-knuth-b3n5fk

Conversation

@jeduden

@jeduden jeduden commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a named TestXxx for each of the 13 unexported helpers in internal/lsp/rename.go (isValidRefDefLine, headingPrepareRange, atxHeadingTextStart, trimTrailingHashRun, skipLeadingSpaces, trimRightSpace, trimmedRange, refDefPrepareRange, refUsePrepareRange, refUseLabelBytes, matchLeadingPair, matchTrailingPair, bracketPairs), satisfying the 2026-06-24 arch audit requirement
  • Go 1.25 enforces uppercase after Test; all names use an uppercase first letter or disambiguating suffix (ATX, Happy, Basic, AllForms)
  • Strengthened after 3 rounds of /code-review xhigh: asserts concrete return values for all-whitespace trimmedRange, verifies Range coordinates in refUsePrepareRange, unconditionally checks i in atxHeadingTextStart table loop, pins zero sentinel in refUseLabelBytes no-match path, and adds pr.close/pr.open boundary cases
  • Marks plan 2606240212 complete; regenerates PLAN.md catalog

Test plan

  • go test ./internal/lsp/... green
  • go vet ./internal/lsp/... green
  • mdsmith check . green (514 files, 0 failures)

🤖 Generated with Claude Code

https://claude.ai/code/session_01JUK9cuin8PW6MjnK2JTxLb


Generated by Claude Code

claude added 3 commits June 24, 2026 06:17
Each helper in internal/lsp/rename.go now has at least one named test
driven directly with byte-slice input, satisfying the audit policy from
the 2026-06-24 architecture audit (plan/2606240212).

Go 1.25 enforces uppercase-first test names, so the originally planned
TestisValidRefDefLine-style names are replaced with PascalCase equivalents
(TestIsValidRefDefLine, TestAtxHeadingTextStart, etc.). The plan's
acceptance criteria are updated to reflect this.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JUK9cuin8PW6MjnK2JTxLb
- Always check i return value in TestAtxHeadingTextStart even when !ok
- Use concrete values 3,3 in TestTrimmedRange all-whitespace case
- Assert Range coordinates in TestRefUsePrepareRangeHappy
- Assert start=0,end=0 in TestRefUseLabelBytesAllForms no-match cases

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JUK9cuin8PW6MjnK2JTxLb
- Add cursor=5 (at ] of text pair) and cursor=6 (at [ of label pair)
  boundary cases to TestRefUseLabelBytesAllForms to pin the >/< boundary
  semantics of the cursorByte < pr.open || cursorByte > pr.close guard
- Fix PLAN.md catalog: 2606240212 row was 🔳 (in-progress) but plan
  file is ✅ (complete); regenerate via mdsmith fix

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

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.62%. Comparing base (6cc286a) to head (ad2864f).

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.

…AllForms

Double-space alignment before inline // comments is not gofmt-canonical;
collapse to single space so golangci-lint gofmt check passes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JUK9cuin8PW6MjnK2JTxLb
@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 24, 2026
@jeduden

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

Copy link
Copy Markdown
Owner Author

🔵 Merge Queue — CI running

Merged into batch branch merge-queue/batch-692-1782284689. 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 24, 2026
@jeduden
jeduden merged commit 1585ea8 into main Jun 24, 2026
32 checks passed
@jeduden

jeduden commented Jun 24, 2026

Copy link
Copy Markdown
Owner Author

Merge Queue — merged

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