test: close targeted coverage gaps (85.1% → 90.9%) - #5
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds characterization tests for genuine, user-facing behaviour that wasn't exercised, lifting total statement coverage from 85.1% to 90.9% without touching any production code. Coverage here is the diagnostic, not the goal — each test pins a behaviour a user can actually trigger, and the deliberately-untestable seams are left alone on purpose.
New coverage:
cli_test.go):accounts --json, flag-parse errors forpnl/accounts, invalidpnl --from, theset-passphrasenon-interactive-terminal guard, and--help.args_test.go):expandTilde(~/~/expansion) andresolveRange's invalid--tobranch.internal/snapshot/snapshot_test.go): malformed schema versions (non-numeric major/minor) andRead's gzip-decompress and JSON-parse error branches. The latter two needed fixtures that are valid age wrapping a bad payload, sointernal/snaptestgained two helpers (WriteAge,WriteGzip) via a behaviour-preserving refactor ofWrite.Package deltas: root
main76.8% → 85.1%,internal/snapshot85.3% → 97.1%.Out of scope by design (and left untested):
main()'sos.Exitwiring, theset-passphrasehappy path (real TTY + keychain write — per CLAUDE.md),os.UserHomeDirfailure, and tabwriter flush errors. Chasing those would mean either coverage theatre or contorting code that's deliberately structured to keep them out of the testable path.Spec and implementation plan are included under
docs/superpowers/.Test plan
go test ./... -racegreen on the dev machineexpandTildeandset-passphrasetests derive home dir fromos.UserHomeDir()and rely on non-TTY stdin respectively — both chosen for cross-platform safety)🤖 Generated with Claude Code