diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-11-19 23:58:35 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-19 23:58:35 +0100 |
| commit | c2a277c11df99f091217d5e35ca3d548606cf15b (patch) | |
| tree | b9b3e3995c937d3ae951c13cfb777e37cb3ad3f8 | |
| parent | 138e96d222b5ac638e62d513a8e303e96ee79c44 (diff) | |
| parent | 65540865266bd5e45c5dc91e7e148dee22b89045 (diff) | |
| download | rust-c2a277c11df99f091217d5e35ca3d548606cf15b.tar.gz rust-c2a277c11df99f091217d5e35ca3d548606cf15b.zip | |
Rollup merge of #79123 - CDirkx:128-bits, r=Mark-Simulacrum
Add u128 and i128 integer tests Add the missing integer tests for u128 and i128 for completeness with the other integer types.
| -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] |
