Skip to main content

Crate falsify

Crate falsify 

Source
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 = shrink(property, shrinker);
    assert_eq!(smallest, 10);
}

Structs§

HasherBuilder

Enums§

TestResult

Traits§

ArbGen
Every generator of arbitrary test inputs of type Y is impl ArbGen<Y>.
ShrinkCoro
Every Y type shrinker is impl ShrinkCoro<Y>.

Functions§

arb_binary_heap_of
arb_bool
arb_box_of
arb_btreemap_of
arb_btreeset_of
arb_hashmap_of
arb_hashset_of
arb_linked_list_of
arb_option_of
arb_rc_of
arb_result_of
arb_tuple2_of
arb_tuple3_of
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_SEED environment variable, if set.
shrink
shrink_binary_heap_len_binary_search
shrink_btreemap_len_binary_search
shrink_btreeset_len_binary_search
shrink_hashmap_len_binary_search
shrink_hashset_len_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 successive Some(t), where t comes from the underlying shirinker for t.
shrink_usize_binary_search
shrink_usize_exhaustive
shrink_vec_deque_len_binary_search
shrink_vec_len_binary_search
shrink_with_rejections