Skip to content

Commit

Permalink
try adding a test that LowerHex and friends don't panic, but it doesn…
Browse files Browse the repository at this point in the history
…'t work
  • Loading branch information
iximeow committed Mar 23, 2024
1 parent c6d2bb7 commit e938dea
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions core/benches/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,17 @@ fn write_u64_min(bh: &mut Bencher) {
test::black_box(format!("{}", 0u64));
});
}

#[bench]
fn write_u8_max(bh: &mut Bencher) {
bh.iter(|| {
test::black_box(format!("{}", u8::MAX));
});
}

#[bench]
fn write_u8_min(bh: &mut Bencher) {
bh.iter(|| {
test::black_box(format!("{}", 0u8));
});
}

0 comments on commit e938dea

Please sign in to comment.