test(review): cover review-diff.ts non-positive-budget guard and header count defaults - #5857
Conversation
…er count defaults Fixes JSONbored#5849. keepHighSignalHunks's budget<=0 guard, its single-hunk head-slice branch, and buildUnifiedReviewDiff's +0/-0 additions/deletions defaults, missing-status default, and below-floor truncation notice had no direct coverage. Adds unit tests for each (branch coverage 66.7%->77.3%).
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #5857 +/- ##
===========================================
- Coverage 95.11% 74.75% -20.37%
===========================================
Files 586 586
Lines 46480 46480
Branches 14860 14860
===========================================
- Hits 44209 34744 -9465
- Misses 1515 8682 +7167
- Partials 756 3054 +2298
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-14 20:19:33 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 4 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Fixes #5849.
src/review/review-diff.tshad untested branches around its budget/size handling. This adds direct unit tests (no production change) for:keepHighSignalHunksnon-positive budget guard —budget <= 0(zero and negative) returns the truncation marker.@@header (hunks.length <= 1) that exceeds the budget is head-sliced with the truncation marker, not dropped whole.buildUnifiedReviewDiffheader defaults — a file with missingadditions/deletionsrenders+0/-0, and a missingstatusdefaults tomodified; provided counts are used when present.…diff truncated (N files total)notice.Branch coverage of the file rises from 66.7% to 77.3%. Test-only; all existing tests still pass (19 total).