Skip to content

Commit 25648de

Browse files
committed
isqrt: disable long running tests in Miri
1 parent fcdfd5b commit 25648de

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

library/core/tests/num/int_macros.rs

+4
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,11 @@ macro_rules! int_module {
299299
assert_eq!((2 as $T).isqrt(), 1 as $T);
300300
assert_eq!((99 as $T).isqrt(), 9 as $T);
301301
assert_eq!((100 as $T).isqrt(), 10 as $T);
302+
}
302303

304+
#[cfg(not(miri))] // Miri is too slow
305+
#[test]
306+
fn test_lots_of_isqrt() {
303307
let n_max: $T = (1024 * 1024).min($T::MAX as u128) as $T;
304308
for n in 0..=n_max {
305309
let isqrt: $T = n.isqrt();

library/core/tests/num/uint_macros.rs

+4
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,11 @@ macro_rules! uint_module {
214214
assert_eq!((99 as $T).isqrt(), 9 as $T);
215215
assert_eq!((100 as $T).isqrt(), 10 as $T);
216216
assert_eq!($T::MAX.isqrt(), (1 << ($T::BITS / 2)) - 1);
217+
}
217218

219+
#[cfg(not(miri))] // Miri is too slow
220+
#[test]
221+
fn test_lots_of_isqrt() {
218222
let n_max: $T = (1024 * 1024).min($T::MAX as u128) as $T;
219223
for n in 0..=n_max {
220224
let isqrt: $T = n.isqrt();

0 commit comments

Comments
 (0)