mirror of
https://github.com/alibaba/open-code-review.git
synced 2026-08-07 07:44:51 +00:00
add comprehensive test coverage for resume.go Add 34 focused tests for session/resume.go, which previously had no dedicated test file. Tests cover every exported and unexported function: - SessionFilePath: empty ID rejection, valid path construction - CompletedCount: nil state, empty items, populated items - Item: nil state, missing key, found key, defensive copy verification - ValidateOptions: nil/workspace/empty/missing mode rejection, mode mismatch, range match/mismatch, commit match/mismatch, unsupported mode - applyResumeLine: session_start, review_item_done (with NewPath fallback and empty fingerprint skip), review_item_reused, review_item_failed (removal + empty fingerprint), unknown type, invalid JSON - applySessionStart: RepoDir preservation/override, SessionID preservation, all fields set - copyLlmComments: nil input, empty slice, deep copy with mutation isolation - LoadResumeState: nonexistent file, empty file, multiple records round-trip, invalid JSON, fail-then-redo replay sequencing |
||
|---|---|---|
| .. | ||
| history.go | ||
| history_test.go | ||
| list.go | ||
| list_test.go | ||
| persist.go | ||
| persist_test.go | ||
| resume.go | ||
| resume_test.go | ||
| testing.go | ||