Skip to content

Commit 1c1b789

Browse files
committed
avoid exhaustive i16 test in Miri
1 parent d4559c0 commit 1c1b789

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

library/core/tests/fmt/num.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,11 @@ fn test_format_int_exp_precision() {
152152
assert_eq!(format!("{:+10.3e}", 1), " +1.000e0");
153153

154154
// test precision remains correct when rounding to next power
155-
156-
for i in i16::MIN..=i16::MAX {
155+
#[cfg(miri)] // can't cover all of `i16` in Miri
156+
let range = [i16::MIN, -1, 1, i16::MAX];
157+
#[cfg(not(miri))]
158+
let range = i16::MIN..=i16::MAX;
159+
for i in range {
157160
for p in 0..=5 {
158161
assert_eq!(
159162
format!("{i:.p$e}"),

0 commit comments

Comments
 (0)