Skip to content

Commit 8a597a8

Browse files
committed
Add very basic test for the integer trait
1 parent 71cf221 commit 8a597a8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/num/integer.rs

+12
Original file line numberDiff line numberDiff line change
@@ -442,3 +442,15 @@ macro_rules! impl_integer {
442442
impl_integer!(u8, u16, u32, u64, u128);
443443
impl_integer!(i8, i16, i32, i64, i128);
444444
impl_integer!(usize, isize);
445+
446+
#[cfg(test)]
447+
mod tests {
448+
#[test]
449+
fn basic() {
450+
assert_eq!(<u8 as super::Integer>::BITS, u8::BITS);
451+
assert_eq!(
452+
<u32 as super::Integer>::trailing_ones(10u32),
453+
10u32.trailing_ones()
454+
);
455+
}
456+
}

0 commit comments

Comments
 (0)