quickcheck
quickcheck copied to clipboard
Automated property based testing for Rust (with shrinking).
I noticed when trying to update a project to `quickcheck` 1.x, that [`Gen`] is now an opaque struct and users implementing `Arbitrary` can only use `Gen::choose` to get randomness. This...
Has cloning the generator been left out on purpose? I want to be able to use the same seed in a generator more than once.
See here https://docs.rs/quickcheck/1.0.3/src/quickcheck/arbitrary.rs.html#255 If it is set to 0, we get ``` thread 'tests::quickcheck_test' panicked at 'cannot sample empty range', /Users/nipunn/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.8.5/src/rng.rs:134:9 ``` I think it would logically make more sense...
It seems like we're formatting the test case arguments even on passing test runs, e.g. here is the flamegraph of a test run where the test passed, but we see...
Previously, the `SignedShrinker` was guaranteed to yield a result if initialized with `::MIN` (e.g. `i32::MIN` for shrinking `i32` and `f32`). This would result in endless shrinking if a test would...
MWE: ``` use quickcheck::quickcheck; #[test] fn negate_value() { fn prop(i: i8) -> bool { -i; true } quickcheck(prop as fn(i8) -> bool); } ``` I think that quickcheck tests this...
Arbitrary impls for nested data often needs access to some kind of random numbers. To avoid exposing rand types, a simple uniformly distributed float on the unit interval is often...
Is there documentation on the idiomatic way to specify the length of an arbitrary vector? My specific example is this: I have a struct with fields containing various data types...
This type was originally motivated by observing that a class of properties will involve a pseudo-identity followed by a check for equivalence between its input and output. A generalization of...