Summary
Add property-based testing using the proptest crate to validate core invariants and round-trip behavior of key components.
Context
Property tests complement unit tests by generating many random inputs and checking universal properties. This is especially valuable for serialization, hashing, and graph traversal.
Tasks
- Add
proptest as a dev-dependency to libvctrl_core, libvctrl_plumbing, or a dedicated test crate.
- Write property tests for:
- Encoder/Decoder round-trip: for any generated
Commit, Tree, Tag, Blob, encoding then decoding yields the original value.
- Hasher idempotence: hashing the same data twice yields the same hash; hashing different data yields different hashes (with high probability).
- RevWalk traversal: for any generated graph, BFS and DFS visits all nodes exactly once; topological order respects dependencies.
- Ensure tests are deterministic and fast enough for CI.
- Add documentation explaining the properties.
Acceptance Criteria
cargo test includes property tests that pass.
- The properties cover at least encoder/decoder and hasher.
Dependencies
- Core implementations (Fase 2) and plumbing functions (Fase 3).
Summary
Add property-based testing using the
proptestcrate to validate core invariants and round-trip behavior of key components.Context
Property tests complement unit tests by generating many random inputs and checking universal properties. This is especially valuable for serialization, hashing, and graph traversal.
Tasks
proptestas a dev-dependency tolibvctrl_core,libvctrl_plumbing, or a dedicated test crate.Commit,Tree,Tag,Blob, encoding then decoding yields the original value.Acceptance Criteria
cargo testincludes property tests that pass.Dependencies