Skip to content

Commit

Permalink
Rollup merge of rust-lang#117946 - RalfJung:miri-libcore-test, r=Mark…
Browse files Browse the repository at this point in the history
…-Simulacrum

avoid exhaustive i16 test in Miri

rust-lang#116301 added a test that is way too slow to be running in Miri. So let's only test a few hopefully representative cases.
  • Loading branch information
TaKO8Ki committed Nov 17, 2023
2 parents 3c0f22d 1c1b789 commit c77cb7a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions library/core/tests/fmt/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 152,11 @@ fn test_format_int_exp_precision() {
assert_eq!(format!("{: 10.3e}", 1), " 1.000e0");

// test precision remains correct when rounding to next power

for i in i16::MIN..=i16::MAX {
#[cfg(miri)] // can't cover all of `i16` in Miri
let range = [i16::MIN, -1, 1, i16::MAX];
#[cfg(not(miri))]
let range = i16::MIN..=i16::MAX;
for i in range {
for p in 0..=5 {
assert_eq!(
format!("{i:.p$e}"),
Expand Down

0 comments on commit c77cb7a

Please sign in to comment.