Function zebra_test::prelude::prop::result::maybe_err_weighted
pub fn maybe_err_weighted<T, E>(
probability_of_err: impl Into<Probability>,
t: T,
e: E,
) -> MaybeErr<T, E>
Expand description
Create a strategy for Result
s where Ok
values are taken from t
and
Err
values are taken from e
.
probability_of_ok
is the probability (between 0.0 and 1.0, exclusive)
that Err
is initially chosen.
Generated values shrink to Ok
.