summaryrefslogtreecommitdiff
path: root/test/lisp/files-tests.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-10-10 01:57:54 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-10-10 01:57:54 +0200
commit9ab3f16c460d91aa556eb35085a90f168b10390f (patch)
treeb65a926dfdb48a2f752bc3bddc6274bde8786dc7 /test/lisp/files-tests.el
parentccea37f6ac503d2e94ca3dc0aa1aad079a2cc8d5 (diff)
downloademacs-9ab3f16c460d91aa556eb35085a90f168b10390f.tar.gz
Fix formatting of (file-size-human-readable 2047)
* lisp/files.el (file-size-human-readable): Don't format slightly-less numbers as X.0k, but just Xk instead (bug#36329).
Diffstat (limited to 'test/lisp/files-tests.el')
-rw-r--r--test/lisp/files-tests.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index ed23f7675cc..60387e1ab2e 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -1282,6 +1282,12 @@ renaming only, rather than modified in-place."
(should (equal (file-size-human-readable 10000 'si " " "bit") "10 kbit"))
(should (equal (file-size-human-readable 10000 'iec " " "bit") "9.8 Kibit"))
+ (should (equal (file-size-human-readable 2048) "2k"))
+ (should (equal (file-size-human-readable 2046) "2k"))
+ (should (equal (file-size-human-readable 2050) "2k"))
+ (should (equal (file-size-human-readable 1950) "1.9k"))
+ (should (equal (file-size-human-readable 2100) "2.1k"))
+
(should (equal (file-size-human-readable-iec 0) "0 B"))
(should (equal (file-size-human-readable-iec 1) "1 B"))
(should (equal (file-size-human-readable-iec 9621) "9.4 KiB"))