Skip to content

test(cli): cover pure helpers — mapErr, mapClientErr, worseStatus, GPU helpers#251

Merged
saadqbal merged 1 commit into
developfrom
test/cli-pure-helpers
Jul 14, 2026
Merged

test(cli): cover pure helpers — mapErr, mapClientErr, worseStatus, GPU helpers#251
saadqbal merged 1 commit into
developfrom
test/cli-pure-helpers

Conversation

@LukasWodka

@LukasWodka LukasWodka commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

The no-infrastructure "free batch" from the coverage audit — pure logic, no production changes.

  • mapErr (0% → covered): Ctrl-C (terminal.InterruptErr) → errInteractiveCancelled (the clean-exit-0 seam contract); other errors pass through.
  • mapClientErr (0%): cancel → nil; else exit-1 *exitError.
  • worseStatus (40%): the Fail>Warn>OK verdict truth-table, both orders.
  • machineGPUShort / currentGPUCount / defaultGPUChoice (all 0%): the GPU wizard's pure helpers.

make ci green. Part of the coverage-audit backlog.

🤖 Generated with Claude Code


Note

Low Risk
Test-only addition with no runtime or behavioral changes to the CLI.

Overview
Adds internal/cli/pure_helpers_coverage_test.go to lock in behavior of previously under-covered CLI helpers—no production code changes.

Tests document the interactive cancel seam: mapErr maps survey Ctrl-C to errInteractiveCancelled (other errors unchanged); mapClientErr turns cancel into a clean nil and other errors into exit-1 *exitError. worseStatus is exercised across the full Fail > Warn > OK truth table (both argument orders). GPU wizard helpers machineGPUShort, currentGPUCount, and defaultGPUChoice get table-driven cases for capacity checks and default prompt values.

Reviewed by Cursor Bugbot for commit a3cf549. Bugbot is set up for automated code reviews on this repo. Configure here.

…U helpers

The no-infrastructure "free batch" from the coverage audit (pure logic, no
production changes):
- mapErr (was 0%): Ctrl-C (terminal.InterruptErr) -> errInteractiveCancelled
  (the clean-exit-0 seam contract); other errors pass through.
- mapClientErr (was 0%): cancel -> nil; else exit-1 *exitError.
- worseStatus (was 40%): the Fail>Warn>OK verdict truth-table, both orders.
- machineGPUShort / currentGPUCount / defaultGPUChoice (all 0%): the GPU
  wizard's pure helpers.

make ci green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@LukasWodka

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit a3cf549. Configure here.

@LukasWodka LukasWodka self-assigned this Jul 14, 2026

@saadqbal saadqbal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 👍 Checked each helper against the impl — the worseStatus truth table and the defaultGPUChoice out-of-range→1 edges all line up. Good pure-function coverage.

@saadqbal
saadqbal merged commit 0806361 into develop Jul 14, 2026
22 checks passed
@saadqbal
saadqbal deleted the test/cli-pure-helpers branch July 14, 2026 08:50
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