diff --git a/tests/mod.rs b/tests/mod.rs index b657a23..3fb7ab9 100644 --- a/tests/mod.rs +++ b/tests/mod.rs @@ -518,8 +518,8 @@ mod allocating { } } -#[test] #[cfg(feature = "zerocopy")] +#[test] #[allow(unused)] fn zerocopy_traits() { use zerocopy::{FromBytes, Immutable, IntoBytes, KnownLayout, Unaligned}; @@ -527,3 +527,13 @@ fn zerocopy_traits() { let ok: Check> = Check(Array([1, 2, 3, 4, 5])); // let not_unaligned: Check::> = Check(Array([1, 2, 3, 4, 5])); } + +#[cfg(feature = "zeroize")] +#[test] +fn zeroize_array() { + use zeroize::Zeroize; + + let mut array: Array = Array([1, 2, 3]); + array.zeroize(); + assert_eq!(&array, &[0, 0, 0]); +}