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
On initialization, the min or max derives do not necessarily work. They don't work on mutation either, which is a related but separate issue.
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>,}fnmain(){// Min/max does not necessarily work on initializationfor _ in0..1000{letmut mutator = Mutator::new(rand::thread_rng());let instance = MyStruct::new_fuzzed(&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());}}
Finished release [optimized] target(s) in 0.22s
Running `target/release/tmp_vendor`
thread 'main' panicked at src/main.rs:20:9:
Got invalid field_1 value 3141465631
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
The text was updated successfully, but these errors were encountered:
On initialization, the
min
ormax
derives do not necessarily work. They don't work on mutation either, which is a related but separate issue.The text was updated successfully, but these errors were encountered: