Add proptest as a dev-dependency in Cargo.toml, then use #[test] functions with proptest! macros to define strategies and assertions.
[dev-dependencies]
proptest = { version = "0.10", default-features = false, features = ["alloc"] }
use proptest::prelude::*;
#[test]
fn test_addition() {
proptest!(|(a in any::<i32>(), b in any::<i32>())| {
prop_assert_eq!(a + b, b + a);
});
}
Set PROPTEST_CASES in your environment to control test iterations, as shown in CI configurations.