Implement SaveSnapshot and GetLatestSnapshot methods on InMemoryEventStore
to satisfy the SnapshotStore interface, and add comprehensive tests covering:
- SaveSnapshot persists snapshots correctly
- GetLatestSnapshot returns most recent snapshot by version
- Behavior when no snapshot exists (returns nil, nil)
- Snapshot versioning is respected across actors
- Version ordering (higher version wins, not insertion order)
- Data integrity for complex, nested, and special character states
- Edge cases: zero version, large version, empty/nil state
Closes#4
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Test all public methods with 100% coverage:
- AddNode: updates ring, is idempotent, handles multiple nodes
- RemoveNode: updates ring, handles non-existent nodes
- GetNode: returns consistent results, handles empty ring and single node
- GetNodes and IsEmpty helper methods
Distribution tests verify:
- Balanced key distribution across nodes (< 25% deviation)
- Minimal key movement when adding nodes (< 35% moved)
- Virtual nodes improve distribution (CV < 15%)
- Ring behavior with 100+ nodes
Includes benchmarks for GetNode, AddNode, and distribution operations.
Closes#2
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Test JSON serialization/deserialization, field names, omitempty behavior,
edge cases (empty/nil data, large payloads, special characters including
unicode and control chars), timestamp handling across timezones, nanosecond
precision, version edge cases, and nested data structures.
Closes#1
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>