diff --git a/src/libstd/num/int.rs b/src/libstd/num/int.rs index 96e182adb82..f336afe12f4 100644 --- a/src/libstd/num/int.rs +++ b/src/libstd/num/int.rs @@ -120,10 +120,3 @@ impl CheckedMul for int { } } } - -#[test] -fn test_overflows() { - assert!((::int::MAX > 0)); - assert!((::int::MIN <= 0)); - assert!((::int::MIN + ::int::MAX + 1 == 0)); -} diff --git a/src/libstd/num/int_macros.rs b/src/libstd/num/int_macros.rs index c0f67912cde..c8d5dc12499 100644 --- a/src/libstd/num/int_macros.rs +++ b/src/libstd/num/int_macros.rs @@ -445,6 +445,13 @@ mod tests { use num::CheckedDiv; use num::Bitwise; + #[test] + fn test_overflows() { + assert!(MAX > 0); + assert!(MIN <= 0); + assert_eq!(MIN + MAX + 1, 0); + } + #[test] fn test_num() { num::test_num(10 as $T, 2 as $T); diff --git a/src/libstd/num/uint.rs b/src/libstd/num/uint.rs index 34611d43677..1811ebc7acc 100644 --- a/src/libstd/num/uint.rs +++ b/src/libstd/num/uint.rs @@ -90,11 +90,3 @@ impl CheckedMul for uint { } } } - -#[test] -fn test_overflows() { - use uint; - assert!((uint::MAX > 0u)); - assert!((uint::MIN <= 0u)); - assert!((uint::MIN + uint::MAX + 1u == 0u)); -} diff --git a/src/libstd/num/uint_macros.rs b/src/libstd/num/uint_macros.rs index 224f16cc663..eb483843b5d 100644 --- a/src/libstd/num/uint_macros.rs +++ b/src/libstd/num/uint_macros.rs @@ -317,6 +317,13 @@ mod tests { use num::Bitwise; use u16; + #[test] + fn test_overflows() { + assert!(MAX > 0); + assert!(MIN <= 0); + assert_eq!(MIN + MAX + 1, 0); + } + #[test] fn test_num() { num::test_num(10 as $T, 2 as $T);