Expand description
Simple usage example (wrap it in a test):
use falsify::*;
let rng = make_test_rng();
let arb = arb_usize(rng);
let property = |n| n < 10;
if let Some(falsifier) = falsify(property, arb) {
let shrinker = shrink_usize_binary_search(falsifier);
let smallest_falsifier = shrink(property, shrinker);
assert_eq!(smallest_falsifier, 10);
}Structs§
- Hasher
Builder - All
HashSet/HashMapcollections in tested code need to use thisHasherBuilderfor the tests to be reproducible!
Enums§
Traits§
- ArbGen
- Every generator of arbitrary test inputs of type
Yisimpl ArbGen<Y>. - Shrink
Coro - Every
Ytype shrinker isimpl ShrinkCoro<Y>.
Functions§
- arb_
binary_ heap_ of - arb_
bool - arb_
box_ of - arb_
btreemap_ of - arb_
btreeset_ of - arb_
char - arb_f32
- arb_f64
- arb_
hashmap_ of - arb_
hashset_ of - arb_i8
- arb_i16
- arb_i32
- arb_i64
- arb_
i128 - arb_
isize - arb_
linked_ list_ of - arb_
option_ of - arb_
rc_ of - arb_
result_ of - arb_
string - arb_
tuple2_ of - arb_
tuple3_ of - arb_u8
- arb_u16
- arb_u32
- arb_u64
- arb_
u128 - arb_
usize - arb_
vec_ deque_ of - arb_
vec_ of - arb_
vec_ of_ rc_ refcell_ of - falsify
- falsify_
times - falsify_
with_ rejections - falsify_
with_ reset - make_
rng_ with_ seed - make_
test_ rng - Takes the seed value from the
FALSIFY_SEEDenvironment variable, if set. - shrink
- shrink_
binary_ heap_ len_ binary_ search - shrink_
bool - shrink_
btreemap_ len_ binary_ search - shrink_
btreeset_ len_ binary_ search - shrink_
char_ binary_ search - shrink_
f32 - shrink_
f64 - shrink_
hashmap_ len_ binary_ search - shrink_
hashset_ len_ binary_ search - shrink_
i8_ binary_ search - shrink_
i16_ binary_ search - shrink_
i32_ binary_ search - shrink_
i64_ binary_ search - shrink_
i128_ binary_ search - shrink_
isize_ binary_ search - shrink_
linked_ list_ len_ binary_ search - shrink_
option - Tactic: Run test with
None. If it failed, we have our smallest falsifier. If the test succeeded, produce successiveSome(t), wheretcomes from the underlying shirinker fort. - shrink_
u8_ binary_ search - shrink_
u16_ binary_ search - shrink_
u32_ binary_ search - shrink_
u64_ binary_ search - shrink_
u128_ binary_ search - shrink_
usize_ binary_ search - shrink_
usize_ exhaustive - shrink_
vec_ deque_ len_ binary_ search - shrink_
vec_ len_ binary_ search - shrink_
with_ rejections