diff options
| author | Christiaan Dirkx <christiaan@dirkx.email> | 2020-11-14 18:45:53 +0100 |
|---|---|---|
| committer | Christiaan Dirkx <christiaan@dirkx.email> | 2020-11-14 20:27:08 +0100 |
| commit | 65540865266bd5e45c5dc91e7e148dee22b89045 (patch) | |
| tree | 76af290cb4834d8a27645cd0da15b24778f1a434 | |
| parent | 25f6938da459a57b43bdf16ed6bdad3225b2a3ce (diff) | |
| download | rust-65540865266bd5e45c5dc91e7e148dee22b89045.tar.gz rust-65540865266bd5e45c5dc91e7e148dee22b89045.zip | |
Add u128 and i128 integer tests
| -rw-r--r-- | library/core/tests/num/i128.rs | 1 | ||||
| -rw-r--r-- | library/core/tests/num/int_macros.rs | 6 | ||||
| -rw-r--r-- | library/core/tests/num/mod.rs | 2 | ||||
| -rw-r--r-- | library/core/tests/num/u128.rs | 1 | ||||
| -rw-r--r-- | library/core/tests/num/uint_macros.rs | 6 |
5 files changed, 10 insertions, 6 deletions
diff --git a/library/core/tests/num/i128.rs b/library/core/tests/num/i128.rs new file mode 100644 index 00000000000..72c0b225991 --- /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 fcb0d6031be..90c47656784 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 49e5cc0eaa5..012ab4ea5c5 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 00000000000..716d1836f2c --- /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 952ec188dc1..445f8fb350e 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] |
