You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Making a separate issue because #1 is an issue in initialization.
When mutating, the constraints aren't applied. An issue and PR in the og repo addresses this for the ignore constraint. landaire#2 landaire#3
use lain::prelude::*;use lain::rand;#[derive(Debug,Mutatable,NewFuzzed,BinarySerialize)]structMyStruct{#[lain(min = 5, max = 7)]field_1:u32,#[lain(min = 5, max = 7)]field_2:Vec<u8>,#[lain(ignore)]ignored_field:u32,}fnmain(){letmut mutator = Mutator::new(rand::thread_rng());letmut instance = MyStruct::new_fuzzed(&mut mutator,None);for _ in0..1000{
instance.mutate(&mut mutator,None);assert!((5..7).contains(&instance.field_1),"Got invalid field_1 value {}", instance.field_1);assert!((5..7).contains(&instance.field_2.len()),"Got invalid field_2 length {}", instance.field_2.len());assert_eq!(instance.ignored_field,u32::default(),"Got invalid ignored_field value {}", instance.ignored_field);}}
The text was updated successfully, but these errors were encountered:
Making a separate issue because #1 is an issue in initialization.
When mutating, the constraints aren't applied. An issue and PR in the og repo addresses this for the
ignore
constraint.landaire#2
landaire#3
The text was updated successfully, but these errors were encountered: