Skip to content

test(coding-agent): add unit tests for countOverlappingOccurrences - #466

Merged
dmae97 merged 1 commit into
dmae97:mainfrom
prascli:fix/462-count-overlapping-occurrences-tests
Nov 18, 2026
Merged

dmae97 merged 1 commit into
dmae97:mainfrom
prascli:fix/462-count-overlapping-occurrences-tests

Conversation

@prascli

@prascli prascli commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

What and why

Adds direct unit tests for countOverlappingOccurrences in packages/coding-agent/src/core/tools/edit-occurrences.ts. The helper is used by the edit tool to detect ambiguous oldText, but had no direct coverage. No source changes. Fixes #462.

Verification

cd packages/coding-agent && npx vitest --run test/edit-occurrences.test.ts

Result: 1 test file, 5 tests passed.

Checklist

  • The change is scoped to one concern
  • npm run check passes locally (targeted vitest passes; full root check needs cargo for the native provider graph, which is not installed here)
  • Tests added or updated where behavior changed
  • Docs updated if user-facing behavior changed (N/A)
  • No new claims (benchmarks, features) without a linked source

@dmae97 dmae97 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the single test-file addition at eac4e495. It covers all five cases from #462, including overlapping starts and the existing empty-needle behavior. I verified the five cases directly against the base source with Node assertions. The fork CI run is awaiting maintainer approval and is still required before merge.

@dmae97
dmae97 merged commit 57c8695 into dmae97:main Nov 18, 2026
5 checks passed
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.

test: add unit tests for countOverlappingOccurrences in core/tools/edit-occurrences.ts

2 participants