monkey_test 0.9.2

A property based testing (PBT) tool like QuickCheck, ScalaCheck and similar libraries, for the Rust programming language.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Shrinkers mainly used for internal testing or debugging, where you want a
//! deterministicly provided candidate values.

use crate::BoxShrink;

/// Provides a fixed sequence of candidates and then ends, having no more values.
pub fn sequence<E>(candidates: &[E]) -> BoxShrink<E>
where
    E: Clone + std::fmt::Debug + 'static,
{
    let data = candidates.to_vec();
    crate::shrinks::from_fn(move |_original| data.clone().into_iter())
}