pub use anyint_macros::int;
pub use anyint_macros::Int;
#[cfg(test)]
mod test {
use super::*;
use crate::prelude::*;
#[test]
fn int_macro_uint() {
assert_eq!(int!(0u6), int::<u8, 6>::new(0));
assert_eq!(int!(63u6), int::<u8, 6>::new(63));
assert_eq!(int!(0u127), int::<u128, 127>::new(0));
}
#[test]
fn int_macro_sint() {
assert_eq!(int!(31i6), int::<i8, 6>::new(31));
assert_eq!(int!(-32i6), int::<i8, 6>::new(-32));
assert_eq!(int!(0i127), int::<i128, 127>::new(0));
}
#[test]
fn type_macro() {
assert_eq!(<Int![u6]>::MAX, int::<u8, 6>::MAX);
assert_eq!(<Int![i6]>::MIN, -32);
assert_eq!(<Int![i31]>::new(16), int::<i32, 31>::new(16));
}
}
#[cfg(doctest)]
mod doctest {
pub struct MacroOnlyTakesValidPositiveUInt;
pub struct MacroOnlyTakesValidNegativeUInt;
pub struct MacroOnlyTakesValidPositiveSInt;
pub struct MacroOnlyTakesValidNegativeSInt;
pub struct MacroOnlyTakesValidWidth;
}