aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMattias EngdegÄrd2019-07-22 17:10:37 +0200
committerMattias EngdegÄrd2019-08-02 12:38:44 +0200
commit408e75e819f70ed47000bc31b34435a4bad33c0c (patch)
treed39724241aa7e9cb463c80124c751c46bab36a98 /test
parentb49d987a8cf5f5dd7ba864e20995e21765eaefcf (diff)
downloademacs-408e75e819f70ed47000bc31b34435a4bad33c0c.tar.gz
emacs-408e75e819f70ed47000bc31b34435a4bad33c0c.zip
Clean up file-size-function
It is now called `byte-count-to-string-function', and used instead of calling `file-size-human-readable' directly where appropriate. * lisp/files.el (file-size-human-readable-iec): New. (file-size-function): Rename to byte-count-to-string-function. Better default value. Eliminate lambda. Better default for custom choice. Put in group `files'. More descriptive doc string. Move. (out-of-memory-warning-percentage, warn-maybe-out-of-memory) (get-free-disk-space): * lisp/dired.el (dired-number-of-marked-files): * lisp/url/url-http.el (url-http-simple-after-change-function) (url-http-content-length-after-change-function): Use byte-count-to-string-function. * test/lisp/files-test.el (files-test-file-size-human-readable): Test file-size-human-readable-iec.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/files-tests.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index df2c3f47ae0..ed23f7675cc 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -1280,7 +1280,12 @@ renaming only, rather than modified in-place."
1280 (should (equal (file-size-human-readable 4294967296 'iec " ") "4 GiB")) 1280 (should (equal (file-size-human-readable 4294967296 'iec " ") "4 GiB"))
1281 (should (equal (file-size-human-readable 10000 nil " " "bit") "9.8 kbit")) 1281 (should (equal (file-size-human-readable 10000 nil " " "bit") "9.8 kbit"))
1282 (should (equal (file-size-human-readable 10000 'si " " "bit") "10 kbit")) 1282 (should (equal (file-size-human-readable 10000 'si " " "bit") "10 kbit"))
1283 (should (equal (file-size-human-readable 10000 'iec " " "bit") "9.8 Kibit"))) 1283 (should (equal (file-size-human-readable 10000 'iec " " "bit") "9.8 Kibit"))
1284
1285 (should (equal (file-size-human-readable-iec 0) "0 B"))
1286 (should (equal (file-size-human-readable-iec 1) "1 B"))
1287 (should (equal (file-size-human-readable-iec 9621) "9.4 KiB"))
1288 (should (equal (file-size-human-readable-iec 72528034765) "67.5 GiB")))
1284 1289
1285(ert-deftest files-test-magic-mode-alist-re-baseline () 1290(ert-deftest files-test-magic-mode-alist-re-baseline ()
1286 "Test magic-mode-alist with RE, expected behaviour for match." 1291 "Test magic-mode-alist with RE, expected behaviour for match."