We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb77498 commit e83cf38Copy full SHA for e83cf38
src/lib.rs
@@ -450,7 +450,7 @@ mod tests {
450
assert_to_string("301.0 KB", ByteSize::kb(301), false);
451
452
assert_to_string("1.0 MiB", ByteSize::mib(1), true);
453
- assert_to_string("1048.6 KB", ByteSize::mib(1), false);
+ assert_to_string("1.0 MB", ByteSize::mib(1), false);
454
455
// a bug case: https://github.com/flang-project/bytesize/issues/8
456
assert_to_string("1.9 GiB", ByteSize::mib(1907), true);
@@ -467,6 +467,12 @@ mod tests {
467
468
assert_to_string("540.9 PiB", ByteSize::pb(609), true);
469
assert_to_string("609.0 PB", ByteSize::pb(609), false);
470
+
471
+ // a bug case: https://github.com/hyunsik/bytesize/issues/26
472
+ assert_to_string("940.0 GiB", ByteSize::gib(940), true);
473
+ assert_to_string("940.0 GB", ByteSize::gb(940), false);
474
+ assert_to_string("1.1 TiB", ByteSize::gib(1090), true);
475
+ assert_to_string("1.1 TB", ByteSize::gb(1090), false);
476
}
477
478
#[test]
0 commit comments