- Made
rand
optional by default; usefeatures = ["with_rand"]
to enable therandom
function. visit_one
now passes ownership of theString
instead of a&str
. It doesn't need to maintain ownership, and if the caller wants it, this may avoid unnecessary clones.- Changes for Clippy.
impl From<String> for Generator
: you could previously saylet g : Generator = "hello".into();
for&str
and can now do so with aString
Add<T>
,AddAssign<T>
,BitOr<T>
, andBitOrAssign<T>
implementations forchar
,&str
, andString
; for example:let mut g = Generator::from("hello"); g |= "salut"; g += ','; g += " "; g += Generator::from("world") | "tout le monde" | "🌎"; g += String::from("!");
- Extra test for a pattern that exceeds
u128
capacity. - Two example programs in the
/examples/
folder. Generator::Empty
variant that is basically a no-op and is also the value returned by the newimpl Default for Generator
.
BitOrAssign
for two OneOf variants incorrectly included an extra digit:let mut g = oneof!('a', 'b'); g += oneof!('x', 'y');
- Renamed
Generator::generate_exact
toGenerator::generate_one
for generating a single string from a Generator - Renamed
Generator::values
toGenerator::generate_all
for iterating over a Generator's range - Renamed
Iter
toIterString
for string iteration over a Generator's range, returned byGenerator::generator_all
Generator::visit_one
to provide each part, in order, as a&str
. For cases where the entire string isn't necessarily needed at once or at all, this avoids allocating and freeing memory.- quickcheck testing
- Additional tests, including of
Generator::regex