Skip to content

Commit 9253a53

Browse files
authored
Add tests for Arbitrary impl on Array (#215)
1 parent fb2957e commit 9253a53

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,15 @@ mod allocating {
553553
}
554554
}
555555

556+
#[cfg(feature = "arbitrary")]
557+
#[test]
558+
fn arbitrary() {
559+
use arbitrary::{Arbitrary, Unstructured};
560+
let mut unstructured = Unstructured::new(EXAMPLE_SLICE);
561+
let array = Array::<u8, U4>::arbitrary(&mut unstructured).unwrap();
562+
assert_eq!(array.as_slice(), &[1, 2, 3, 4]);
563+
}
564+
556565
#[cfg(feature = "zerocopy")]
557566
#[test]
558567
#[allow(unused)]

0 commit comments

Comments
 (0)