Property-based testing for Rust — a modern, maintained replacement for quickcheck.
- API-compatible with quickcheck for easy migration
- Const generics support for arrays of any size
- Deterministic seeds via
QUICKCHECK_SEEDfor reproducible failures - More Arbitrary impls for newer std types
#[quickcheck]proc macro for ergonomic test definitions- Rust 1.75+ MSRV
use disprove::{quickcheck, Arbitrary, Gen};
fn prop_sort_is_idempotent(mut xs: Vec<i32>) -> bool {
xs.sort();
let sorted = xs.clone();
xs.sort();
xs == sorted
}
#[test]
fn test_sort() {
quickcheck(prop_sort_is_idempotent as fn(Vec<i32>) -> bool);
}Licensed under either of Apache License, Version 2.0 or MIT License at your option.