use super::size_cell;
#[test]
fn the_size_cell_matches_the_reference_tools() {
assert_eq!(size_cell(98_234_179), "98.2MB");
assert_eq!(size_cell(805_007), "805kB");
assert_eq!(size_cell(1_010_000_000), "1.01GB");
}
#[test]
fn the_size_cell_uses_the_decimal_ladder() {
let cell = size_cell(98_234_179);
assert!(
cell.ends_with("MB"),
"{cell:?} is not on the decimal ladder"
);
assert!(!cell.contains("iB"), "{cell:?} used a binary unit");
}
#[test]
fn a_missing_image_leaves_the_cell_empty() {
assert_eq!(size_cell(0), "");
}
#[test]
fn a_one_byte_image_still_renders() {
assert_eq!(size_cell(1), "1B");
}