Remove Signed Wrapping test because Wrapping doesn't impl Neg in Rust 1.8

This commit is contained in:
Yoan Lecoq 2017-04-30 10:45:51 +02:00
parent 3896c64dc7
commit 3b7a775f38
1 changed files with 0 additions and 24 deletions

View File

@ -187,27 +187,3 @@ empty_trait_impl!(Unsigned for usize u8 u16 u32 u64);
impl<T: Unsigned> Unsigned for Wrapping<T> where Wrapping<T>: Num {} impl<T: Unsigned> Unsigned for Wrapping<T> where Wrapping<T>: Num {}
macro_rules! test_signed_wrapping {
($($t:ty)+) => {
$({
let range = -1 as $t .. 2 as $t;
for i in range.clone() {
let w = Wrapping(i);
assert_eq!(signum(i), signum(w).0);
assert_eq!(abs(i), abs(w).0);
for j in range.clone() {
assert_eq!(abs_sub(i, j), abs_sub(w, Wrapping(j)).0);
}
assert_eq!(i.is_positive(), w.is_positive());
assert_eq!(i.is_negative(), w.is_negative());
}
})+
};
}
#[test]
fn signed_wrapping() {
test_signed_wrapping!(isize i8 i16 i32 i64);
}