use super::*;
pub type NonZeroByteSet = Set<core::num::NonZeroU8>;
pub type NonZeroI8Set = Set<core::num::NonZeroI8>;
pub type NonZeroU8Set = NonZeroByteSet;
#[cfg(test)]
mod tests
{
use super::*;
pub fn space_of<K, V>(map: &Map<K,V>) -> usize
{
map.internal_size_bytes()
}
mod allocsz {
use super::*;
pub fn assert_space_of<T, K, V>(map: T, expected: usize)
where T: std::borrow::Borrow<Map<K,V>>
{
let sz = space_of(map.borrow());
assert_eq!(sz, expected, "unexpected full allocated size of type {}: expected {expected}, got {sz}.", std::any::type_name::<Map<K,V>>());
}
macro_rules! size_test {
($name:ident, $type:ty, $num:expr) => {
#[test]
fn $name() {
assert_space_of(<$type>::new(), $num);
}
}
}
size_test!(non_zero_byte_set, NonZeroByteSet, 256);
size_test!(non_zero_u8_set, NonZeroU8Set, 256);
size_test!(non_zero_i8_set, NonZeroI8Set, 256);
}
}