File size: 719 Bytes
598316f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/tests/test_filesize.py b/tests/test_filesize.py
index e695639..c564bf2 100644
--- a/tests/test_filesize.py
+++ b/tests/test_filesize.py
@@ -103,3 +103,12 @@ def test_naturalsize(test_args: list[int] | list[int | bool], expected: str) ->
         test_args[0] = f"-{test_args[0]}"
 
     assert humanize.naturalsize(*test_args) == "-" + expected
+
+
+def test_naturalsize_can_keep_the_pre_rounding_suffix() -> None:
+    assert humanize.naturalsize(999_999, format="%.1f", rollover=False) == "1000.0 kB"
+    assert (
+        humanize.naturalsize(1024**2 - 1, binary=True, rollover=False)
+        == "1024.0 KiB"
+    )
+    assert humanize.naturalsize(1024**2 - 1, gnu=True, rollover=False) == "1024.0K"