extern crate byte_mutator;
use byte_mutator::*;
#[test]
fn mutator_from_config() {
let mut bytes = ByteMutator::new_from_config(b"foo", FuzzConfig::default());
for _ in 0..20 {
bytes.next();
}
assert!(bytes.remaining_stages() >= 1);
}
#[test]
fn mutator() {
let mut bytes = ByteMutator::new(b"foo").with_stages(vec![Stage {
count: 0,
iterations: Iterations::Bits,
mutations: vec![Mutation {
range: None,
mutation: MutationType::BitFlipper { width: 1 },
}],
}]);
assert_eq!(bytes.read(), b"foo");
bytes.next();
assert_eq!(bytes.read(), b"goo");
}