Skip to content

Commit c2a277c

Browse files
authored
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.
2 parents 138e96d + 6554086 commit c2a277c

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

library/core/tests/num/i128.rs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int_module!(i128, i128);

library/core/tests/num/int_macros.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ macro_rules! int_module {
131131
assert_eq!(B.rotate_left(0), B);
132132
assert_eq!(C.rotate_left(0), C);
133133
// Rotating by a multiple of word size should also have no effect
134-
assert_eq!(A.rotate_left(64), A);
135-
assert_eq!(B.rotate_left(64), B);
136-
assert_eq!(C.rotate_left(64), C);
134+
assert_eq!(A.rotate_left(128), A);
135+
assert_eq!(B.rotate_left(128), B);
136+
assert_eq!(C.rotate_left(128), C);
137137
}
138138

139139
#[test]

library/core/tests/num/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use core::str::FromStr;
1111
#[macro_use]
1212
mod int_macros;
1313

14+
mod i128;
1415
mod i16;
1516
mod i32;
1617
mod i64;
@@ -19,6 +20,7 @@ mod i8;
1920
#[macro_use]
2021
mod uint_macros;
2122

23+
mod u128;
2224
mod u16;
2325
mod u32;
2426
mod u64;

library/core/tests/num/u128.rs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uint_module!(u128, u128);

library/core/tests/num/uint_macros.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ macro_rules! uint_module {
9696
assert_eq!(B.rotate_left(0), B);
9797
assert_eq!(C.rotate_left(0), C);
9898
// Rotating by a multiple of word size should also have no effect
99-
assert_eq!(A.rotate_left(64), A);
100-
assert_eq!(B.rotate_left(64), B);
101-
assert_eq!(C.rotate_left(64), C);
99+
assert_eq!(A.rotate_left(128), A);
100+
assert_eq!(B.rotate_left(128), B);
101+
assert_eq!(C.rotate_left(128), C);
102102
}
103103

104104
#[test]

0 commit comments

Comments
 (0)