Expand description
This mutation is chosen when the element mutator is a “unit” mutator, meaning that it can only produce a single value. In this case, the vector mutator’s role is simply to choose a length.
For example, if we have:
use fuzzcheck::{Mutator, DefaultMutator};
use fuzzcheck::mutators::vector::VecMutator;
let m /* : impl Mutator<Vec<()>> */ = VecMutator::new(<()>::default_mutator(), 2..=5, true);
Then the values that m
can produce are only:
[(), ()]
[(), (), ()]
[(), (), (), ()]
[(), (), (), (), ()]
and nothing else.
We can detect if the element mutator is a unit mutator by calling
m.global_search_space_complexity()
. If the complexity is 0.0
, then the
mutator is only capable of producing a single value.