From 9284873e498593f587cb8c069c621476d3e6e8cd Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Mon, 6 Apr 2026 12:08:30 -0600 Subject: [PATCH] Add tests for `Arbitrary` impl on `Array` --- tests/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/mod.rs b/tests/mod.rs index 5fad232..78aa932 100644 --- a/tests/mod.rs +++ b/tests/mod.rs @@ -553,6 +553,15 @@ mod allocating { } } +#[cfg(feature = "arbitrary")] +#[test] +fn arbitrary() { + use arbitrary::{Arbitrary, Unstructured}; + let mut unstructured = Unstructured::new(EXAMPLE_SLICE); + let array = Array::::arbitrary(&mut unstructured).unwrap(); + assert_eq!(array.as_slice(), &[1, 2, 3, 4]); +} + #[cfg(feature = "zerocopy")] #[test] #[allow(unused)]