586 releases

new 0.0.587 May 26, 2024
0.0.561 Apr 30, 2024
0.0.531 Mar 31, 2024
0.0.440 Dec 31, 2023
0.0.7 Nov 11, 2021

#507 in Testing

Download history 141/week @ 2024-02-03 370/week @ 2024-02-10 889/week @ 2024-02-17 2609/week @ 2024-02-24 1287/week @ 2024-03-02 1490/week @ 2024-03-09 1458/week @ 2024-03-16 1186/week @ 2024-03-23 1383/week @ 2024-03-30 1218/week @ 2024-04-06 1316/week @ 2024-04-13 1309/week @ 2024-04-20 1332/week @ 2024-04-27 1354/week @ 2024-05-04 1334/week @ 2024-05-11 1129/week @ 2024-05-18

5,339 downloads per month
Used in 4 crates

MIT/Apache

57KB
1.5K SLoC

prop-check-rs

A Rust crate for property-based testing.

Workflow Status crates.io docs.rs tokei

Install to Cargo.toml

Add this to your Cargo.toml:

[dependencies]
prop-check-rs = "<<version>>"

Usage

Choose one value from a list

#[test]
fn test_one_of() -> Result<()> {
  let gen = Gens::one_of_values(['a', 'b', 'c', 'x', 'y', 'z']);
  let prop = for_all_gen(gen, move |value| {
      log::info!("value = {}", value);
      true
  });
  test_with_prop(prop, 1, 100, new_rng())
}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~2.5MB
~48K SLoC