Commit Graph

3 Commits

Author SHA1 Message Date
185c645238 Merge main and address review feedback
All checks were successful
CI / build (pull_request) Successful in 17s
- Add mutex protection to SaveSnapshot and GetLatestSnapshot
- Add nil validation in SaveSnapshot
- Fix key collision in TestSnapshotDataIntegrity_LargeState (use fmt.Sprintf)
- Add concurrent access tests for snapshots

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 17:34:22 +01:00
032fda41ce Add comprehensive unit tests for InMemoryEventStore
All checks were successful
CI / build (pull_request) Successful in 15s
CI / build (push) Successful in 15s
- Test SaveEvent persists events correctly (single, multiple, multi-actor)
- Test GetEvents retrieves events in insertion order
- Test GetEvents with fromVersion filtering
- Test GetLatestVersion returns correct version
- Test behavior with non-existent actor IDs (returns empty/zero)
- Test concurrent access safety with race detector
- Add mutex protection to InMemoryEventStore for thread safety

Closes #3

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 17:14:18 +01:00
0b2b6a3125 Add comprehensive unit tests for SnapshotStore
All checks were successful
CI / build (pull_request) Successful in 17s
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>
2026-01-09 17:13:02 +01:00