test(downloader): add unit tests for range request logic #132
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/pget#132
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
internal/downloader/range.gohas no tests. The range request logic is core to parallel chunked downloads and should have table-driven tests.Should cover:
ProbeURL— HEAD request handling, Content-Length parsing, Accept-Ranges detectionSplitChunks— equal division, last chunk absorbs remainder, edge cases (zero size, negative size, single chunk)BuildRangeHeader— valid Range header format for various chunksConsider using
httptest.NewServerfor testingProbeURL.Discovered during review of PR #130.
Closing — handled in PR #161. SplitChunks, BuildRangeHeader, and ProbeURL tests in download_test.go.