On case of test failure hypothesis suggests to add decorator @reproduce_faliure("") to easily reproduce and debug a particular failure. This is very convenient for the usual pipeline Test -> Fix failure with debugger -> Look for the next…
I want to thoroughly test an implementation of the intersection of two BTreeSets. I can write:
use self::proptest::prelude::*;
proptest! {
#[test]
fn intersect_this(s1: BTreeSet, s2: BTreeSet) {
// ...
}
}
But this has…
I'd like to create a JSON strategy using rust proptest library. However, I do not want to create an arbitrary JSON. I'd like to create it according to a schema (more specifically, OpenAPI schema). This means that keys of the JSON are known and I do…
I want to generate DAGs with proptest. The algorithm that I pick would be this. I've written the plain algorithm below -- but I need help transforming this to a proptest strategy.
What would a strategy need to look like that did the same as the…
I want to create a Strategy that generates u32 values less than 1000000 efficiently and uniformly. The only two ways that I know to do this are to use any::() and then do one of the following:
use prop_filter to filter out values greater than…
I am using the proptest crate to run some property tests in a no_std environment. proptest's default test_runner::TestRunner::run() implementation takes some input (as a Strategy or ValueTree object defined in proptest) and a function closure as…