test(activity): add missing cache layer unit tests #326
No reviewers
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/steeper!326
Loading…
Reference in a new issue
No description provided.
Delete branch "phase08-cache-tests"
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?
What
Add missing unit tests for the cache layer, completing #270.
New tests
OpenWithRecoverydetects corruption, removes the file, and creates a fresh valid databaseCheckIntegrity()passes on a fresh file-based DBWindow()getter returns an empty window before loadErrCorruptedsentinel and modernc.org/sqlite's "not a database" error stringCoverage
91.3% → 91.9% (uncovered lines are all unreachable error branches)
References: #270, #267, #268, #269
Testing
go test -race ./...— all passReview
Result: Approved — no blocking issues.
Summary: Adds cache layer test coverage. New
isCorruptErr()helper handles bothErrCorruptedsentinel and modernc.org/sqlite's raw "not a database" error string — used byOpenWithRecoveryfor robust corruption detection. Tests: corrupted file recovery, file-based integrity check, view Window() getter. ROADMAP2.md updated.Minor:
TestOpenReturnsErrorOnPingFailureduplicates existingTestOpenInvalidPath(same path, same assertion). Non-blocking.Checklist:
isCorruptErrhandles both error paths correctly, recovery works on garbage filesgo test -racepasses