Skip to content

test: increase coverage from 62% to 93%#3

Merged
vigo merged 1 commit intomainfrom
improve-tests
Feb 15, 2026
Merged

test: increase coverage from 62% to 93%#3
vigo merged 1 commit intomainfrom
improve-tests

Conversation

@vigo
Copy link
Owner

@vigo vigo commented Feb 15, 2026

Summary

  • Add comprehensive tests for all major untested code paths across 6 test files (+627 lines)
  • Coverage: 62.4% → 92.9% (app package), 61.9% → 92.1% (total)
  • No source code changes — all new code is in _test.go files

Test groups added:

  • Constructor & flags: NewCLIApplication, parseFlags (version, defaults, custom, invalid limit, chunks bounds)
  • Run integration: successful download, version flag, empty URL, 404 resource, multiple files, failed download
  • Progress lifecycle: start() → ticker → render()finish(), multiple entries
  • Download error paths: chunked OpenFile error, 500 response, resume with range ignored, cancelled context, chunked+single fallback fail
  • Small gaps: rate limiter large buffer cap, large N wait, finalizePart nonexistent path, parsePipe ErrReader, fetchToFile non-206, root URL basename fallback, checkDiskSpace invalid path

Test plan

  • go test -race ./... passes
  • golangci-lint run ./... — 0 issues
  • Coverage verified: 92.9% (target was 80%+)

🤖 Generated with Claude Code

Add tests for all major untested code paths:
- NewCLIApplication constructor, parseFlags, and Run integration
- progress display lifecycle (start/render/finish)
- download error paths (chunked fail, single fail, 500, cancelled ctx)
- rate limiter edge cases (large buffer cap, large N wait)
- resume with server ignoring Range, finalizePart errors
- resource info for root URLs, fetchToFile non-206 responses

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@codecov
Copy link

codecov bot commented Feb 15, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@vigo vigo merged commit 615be3b into main Feb 15, 2026
4 checks passed
@vigo vigo deleted the improve-tests branch February 15, 2026 10:48
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