Skip to content

test(backend): add unit tests for PartitionState type#68

Merged
refcell merged 1 commit intomainfrom
impl-beta/add-partition-state-tests-v2
Feb 1, 2026
Merged

test(backend): add unit tests for PartitionState type#68
refcell merged 1 commit intomainfrom
impl-beta/add-partition-state-tests-v2

Conversation

@refcell
Copy link
Owner

@refcell refcell commented Feb 1, 2026

Summary

Add comprehensive unit tests for the PartitionState type in the backend crate.

Changes

  • crates/storage/backend/src/partition.rs: Added 17 new unit tests covering:
    • new() and default() return uninitialized state
    • initialize() state transitions (success from uninitialized, fail from ready/closed)
    • get() returns reference when ready, errors otherwise
    • get_mut() allows mutation when ready, errors otherwise
    • close() state transitions (success from ready, errors otherwise)
    • is_ready() accurately reflects state throughout lifecycle
    • Debug trait implementation

Verification

  • All 17 tests pass
  • Clippy clean
  • Comprehensive state machine coverage for partition lifecycle

@refcell refcell merged commit 905a435 into main Feb 1, 2026
5 checks passed
@refcell refcell deleted the impl-beta/add-partition-state-tests-v2 branch February 1, 2026 23:46
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