Overview
The payment split and release-funds logic is tested with fixed examples only. Add property-based tests that generate random inputs and verify invariants hold regardless of values.
Acceptance Criteria
- Property-based tests using
proptest or quickcheck crate
- Properties tested:
- Sum of all recipient payouts equals the total invoice amount (no rounding loss)
- No recipient receives more than their percentage entitles them to
release_funds is idempotent (calling twice does not double-pay)
- A fully-funded invoice always has
funded_amount >= target_amount
- Recipient percentages always sum to exactly 100
- 1000 random test cases generated per property
- Shrinking enabled: failing case minimized to the simplest reproducer
- Tests run in CI as part of
cargo test
- Any property violation blocks merge
Overview
The payment split and release-funds logic is tested with fixed examples only. Add property-based tests that generate random inputs and verify invariants hold regardless of values.
Acceptance Criteria
proptestorquickcheckcraterelease_fundsis idempotent (calling twice does not double-pay)funded_amount >= target_amountcargo test