#property-based #property-based-testing

dev bin+lib prop-check-rs

A Property-based testing Library in Rust

830 releases

0.0.831 Jan 27, 2025
0.0.805 Dec 31, 2024
0.0.774 Nov 30, 2024
0.0.653 Jul 31, 2024
0.0.7 Nov 11, 2021

#219 in Text processing

Download history 1131/week @ 2024-10-27 1030/week @ 2024-11-03 1003/week @ 2024-11-10 1227/week @ 2024-11-17 1264/week @ 2024-11-24 1132/week @ 2024-12-01 1234/week @ 2024-12-08 1102/week @ 2024-12-15 1112/week @ 2024-12-22 1440/week @ 2024-12-29 1223/week @ 2025-01-05 960/week @ 2025-01-12 998/week @ 2025-01-19 402/week @ 2025-01-26 127/week @ 2025-02-02 40/week @ 2025-02-09

1,704 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
~50K SLoC