Skip to content

Claude: Create tests for CRDTs#23

Open
jprider63 wants to merge 2 commits intofeature/bftfrom
claude/add-crdt-tests-yA652
Open

Claude: Create tests for CRDTs#23
jprider63 wants to merge 2 commits intofeature/bftfrom
claude/add-crdt-tests-yA652

Conversation

@jprider63
Copy link
Owner

No description provided.

This commit adds extensive test coverage for all CRDT implementations
in the ossa-crdt crate, including:

- LWW (Last-Writer-Wins) Register: 7 tests (4 unit + 3 property-based)
- TwoPMap (Two-Phase Map): 13 tests (10 unit + 3 property-based)
- CausalTree (text CRDT): 13 tests (9 unit + 4 property-based)

Total: 33 tests covering correctness, convergence, and CRDT properties.

Key improvements:
- Added proptest dependency for property-based testing
- Implemented Clone for CausalTreeOp and TwoPMapOp to support tests
- Added helper methods to CausalTree (new(), to_string())
- Added helper methods to CausalTreeOp (insert(), delete())
- Fixed zerocopy nightly compatibility issue with cargo config
- Added SimpleCausalState test helper for time ordering

Tests verify:
- Basic CRDT operations (insert, update, delete)
- Convergence properties across replicas
- Commutativity of concurrent operations
- Correct handling of tombstones in TwoPMap
- Text reconstruction in CausalTree
- LWW conflict resolution with tiebreaking
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.

2 participants