prop-check-rs

Crates.ioprop-check-rs
lib.rsprop-check-rs
version0.0.575
sourcesrc
created_at2021-08-19 15:00:46.911698
updated_at2024-05-14 00:17:00.253106
descriptionA Property-based testing Library in Rust
homepage
repositoryhttps://github.com/j5ik2o/prop-check-rs
max_upload_size
id439649
size86,804
Junichi Kato (j5ik2o)

documentation

README

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.

Commit count: 806

cargo fmt