Skip to content

test: cover actionable non-script gaps#372

Merged
benvinegar merged 1 commit into
mainfrom
test/cover-actionable-gaps
May 25, 2026
Merged

test: cover actionable non-script gaps#372
benvinegar merged 1 commit into
mainfrom
test/cover-actionable-gaps

Conversation

@benvinegar
Copy link
Copy Markdown
Member

Summary

  • add focused coverage for patch chunk splitting and fallback matching
  • cover session registration exports, reload metadata refreshes, and initial snapshot defaults
  • cover review-state navigation helpers and remaining session command dispatch branches

Testing

  • bun test src/core/patch/chunks.test.ts src/hunk-session/sessionRegistration.test.ts src/ui/lib/reviewState.test.ts src/session/commands.test.ts
  • bun run typecheck
  • bun run lint
  • bun run format:check

This PR description was generated by Pi using OpenAI GPT-5

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 25, 2026

Greptile Summary

This PR is test-only, adding focused unit tests across four modules to close coverage gaps in patch chunk splitting, session registration, review-state navigation, and session command dispatch.

  • chunks.test.ts: Covers splitPatchIntoFileChunks for plain (non-git) unified diffs and findPatchChunk fallback matching by current/previous path, plus the no-match empty-string return.
  • sessionRegistration.test.ts: Covers createSessionRegistration hunk/repo-root export, updateSessionRegistration identity preservation across reloads, and createInitialSessionSnapshot for both a populated and an empty changeset.
  • reviewState.test.ts / commands.test.ts: Cover buildSelectedHunkSummary stale-index path, findNextAnnotatedFile wrap-around and empty-stream cases, all five resolveReviewNavigationTarget error branches, and the remaining navigate/comment-* dispatch paths in runSessionCommand.

Confidence Score: 5/5

Test-only additions with no production code changes; all assertions were verified against their corresponding source implementations.

Every test assertion was traced against the actual source logic and found correct: chunk splitting, path normalization, session identity preservation, hunk range derivation, annotated-file wrap-around math, and all five navigation error throws. The existing afterEach cleanup applies to the new commands tests. No production code is modified.

No files require special attention.

Important Files Changed

Filename Overview
src/core/patch/chunks.test.ts New test file covering splitPatchIntoFileChunks for plain unified diffs and findPatchChunk fallback path/index matching; assertions align with the source implementation.
src/hunk-session/sessionRegistration.test.ts New test file covering createSessionRegistration, updateSessionRegistration identity preservation, and createInitialSessionSnapshot for both populated and empty changesets; all assertions match source logic.
src/ui/lib/reviewState.test.ts New test file covering buildSelectedHunkSummary stale-index path, findNextAnnotatedFile wrap-around/empty-stream cases, and resolveReviewNavigationTarget for comment direction, explicit hunk/line targeting, and all five error branches.
src/session/commands.test.ts Extends existing test suite with a no-daemon early-return test for the list command and a combined dispatch test covering navigate, comment-list, comment-rm, and comment-clear with inline output assertions; test hooks and afterEach cleanup are correctly wired.

Reviews (1): Last reviewed commit: "test: cover actionable non-script gaps" | Re-trigger Greptile

@benvinegar benvinegar merged commit 67b91b8 into main May 25, 2026
8 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.

1 participant