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