test(resume): add unit tests for resume state management #144
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#144
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/resume.gohas no tests. 112 lines of serialization/deserialization, file I/O, and thread-safe state management with zero coverage.Should cover:
SaveResumeState— writes valid JSON to.pgetfileLoadResumeState— loads valid state, handles missing file, corrupted JSON, size mismatch, chunk count mismatchIsDone— returns correct status for completed/incomplete chunksMarkDone— marks chunk, thread safetyVerifyFileSize— exact match, mismatch, stat errorCleanupResumeState— removes filemetaPath— correct path generationDownload(): state saved after each chunk, cleaned up on success, preserved on failureDiscovered during review of PR #142.
Closing — implemented in PR #164. Tests added for config, logging, HTTP client, FTP client, and resume state management.