summaryrefslogtreecommitdiff
path: root/test/lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2021-12-03 17:01:30 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2021-12-03 17:22:59 +0100
commit52b2ffd83b95c2bd974f23f71860a5ea123e3b02 (patch)
treeac33efff5bb0ead939c35934408d1261a32309da /test/lisp
parent20124d78e7b5a063a37eeecce06f4d42f0cf08ed (diff)
downloademacs-52b2ffd83b95c2bd974f23f71860a5ea123e3b02.tar.gz
emacs-52b2ffd83b95c2bd974f23f71860a5ea123e3b02.tar.bz2
emacs-52b2ffd83b95c2bd974f23f71860a5ea123e3b02.zip
Improve how dired-mark-sexp interprets file sizes in non-C locales
* lisp/dired-x.el (dired-x--string-to-number): Try to understand localised numbers (with "." separators or the like) (bug#23373).
Diffstat (limited to 'test/lisp')
-rw-r--r--test/lisp/dired-x-tests.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/lisp/dired-x-tests.el b/test/lisp/dired-x-tests.el
index fe4b9711d49..c6ac7c602ea 100644
--- a/test/lisp/dired-x-tests.el
+++ b/test/lisp/dired-x-tests.el
@@ -60,5 +60,12 @@
(should (equal (dired-guess-default '("/tmp/foo.png" "/tmp/foo.txt"))
nil))))
+(ert-deftest dired-x--string-to-number ()
+ (should (= (dired-x--string-to-number "2.4K") 2457.6))
+ (should (= (dired-x--string-to-number "2400") 2400))
+ (should (= (dired-x--string-to-number "123.4M") 129394278.4))
+ (should (= (dired-x--string-to-number "123.40000M") 129394278.4))
+ (should (= (dired-x--string-to-number "4.134") 4134)))
+
(provide 'dired-x-tests)
;;; dired-x-tests.el ends here