From 65540865266bd5e45c5dc91e7e148dee22b89045 Mon Sep 17 00:00:00 2001 From: Christiaan Dirkx Date: Sat, 14 Nov 2020 18:45:53 +0100 Subject: [PATCH] Add u128 and i128 integer tests --- library/core/tests/num/i128.rs | 1 + library/core/tests/num/int_macros.rs | 6 +++--- library/core/tests/num/mod.rs | 2 ++ library/core/tests/num/u128.rs | 1 + library/core/tests/num/uint_macros.rs | 6 +++--- 5 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 library/core/tests/num/i128.rs create mode 100644 library/core/tests/num/u128.rs diff --git a/library/core/tests/num/i128.rs b/library/core/tests/num/i128.rs new file mode 100644 index 0000000000000..72c0b225991f6 --- /dev/null +++ b/library/core/tests/num/i128.rs @@ -0,0 +1 @@ +int_module!(i128, i128); diff --git a/library/core/tests/num/int_macros.rs b/library/core/tests/num/int_macros.rs index fcb0d6031be62..90c476567844e 100644 --- a/library/core/tests/num/int_macros.rs +++ b/library/core/tests/num/int_macros.rs @@ -131,9 +131,9 @@ macro_rules! int_module { assert_eq!(B.rotate_left(0), B); assert_eq!(C.rotate_left(0), C); // Rotating by a multiple of word size should also have no effect - assert_eq!(A.rotate_left(64), A); - assert_eq!(B.rotate_left(64), B); - assert_eq!(C.rotate_left(64), C); + assert_eq!(A.rotate_left(128), A); + assert_eq!(B.rotate_left(128), B); + assert_eq!(C.rotate_left(128), C); } #[test] diff --git a/library/core/tests/num/mod.rs b/library/core/tests/num/mod.rs index 49e5cc0eaa544..012ab4ea5c573 100644 --- a/library/core/tests/num/mod.rs +++ b/library/core/tests/num/mod.rs @@ -11,6 +11,7 @@ use core::str::FromStr; #[macro_use] mod int_macros; +mod i128; mod i16; mod i32; mod i64; @@ -19,6 +20,7 @@ mod i8; #[macro_use] mod uint_macros; +mod u128; mod u16; mod u32; mod u64; diff --git a/library/core/tests/num/u128.rs b/library/core/tests/num/u128.rs new file mode 100644 index 0000000000000..716d1836f2c0e --- /dev/null +++ b/library/core/tests/num/u128.rs @@ -0,0 +1 @@ +uint_module!(u128, u128); diff --git a/library/core/tests/num/uint_macros.rs b/library/core/tests/num/uint_macros.rs index 952ec188dc138..445f8fb350eeb 100644 --- a/library/core/tests/num/uint_macros.rs +++ b/library/core/tests/num/uint_macros.rs @@ -96,9 +96,9 @@ macro_rules! uint_module { assert_eq!(B.rotate_left(0), B); assert_eq!(C.rotate_left(0), C); // Rotating by a multiple of word size should also have no effect - assert_eq!(A.rotate_left(64), A); - assert_eq!(B.rotate_left(64), B); - assert_eq!(C.rotate_left(64), C); + assert_eq!(A.rotate_left(128), A); + assert_eq!(B.rotate_left(128), B); + assert_eq!(C.rotate_left(128), C); } #[test]