diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2014-09-07 10:24:44 +0200 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2014-09-07 10:24:44 +0200 |
commit | 47ae4ce33d54643c8adb0a2f9791a4132e0eb306 (patch) | |
tree | 2e66ab1891ec54ad7ddfea0d98eea0cb6b1b2bdf /test | |
parent | b3bf18b3b87ac8f00857b8bfc3f2c74cf0e2fb7d (diff) | |
download | emacs-47ae4ce33d54643c8adb0a2f9791a4132e0eb306.tar.gz |
* automated/fns-tests.el (fns-tests--collate-enabled-p): New function.
(fns-tests-collate-strings, fns-tests-collate-sort): Use it.
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/automated/fns-tests.el | 17 |
2 files changed, 19 insertions, 3 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 28f6a918676..db3a35c3644 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2014-09-07 Michael Albinus <michael.albinus@gmx.de> + + * automated/fns-tests.el (fns-tests--collate-enabled-p): New function. + (fns-tests-collate-strings, fns-tests-collate-sort): Use it. + 2014-09-05 Michael Albinus <michael.albinus@gmx.de> * automated/fns-tests.el (fns-tests-compare-strings): In case diff --git a/test/automated/fns-tests.el b/test/automated/fns-tests.el index aa9f35f338e..1894b44bf42 100644 --- a/test/automated/fns-tests.el +++ b/test/automated/fns-tests.el @@ -101,10 +101,19 @@ (should (= (compare-strings "んにちはコンニチハこ" nil nil "こんにちはコンニチハ" nil nil) 1)) (should (= (compare-strings "こんにちはコンニチハ" nil nil "んにちはコンニチハこ" nil nil) -1))) +(defun fns-tests--collate-enabled-p () + "Check whether collation functions are enabled." + (and + ;; When there is no collation library, collation functions fall back + ;; to their lexicographic counterparts. We don't need to test then. + (not (ignore-errors (string-collate-equalp "" "" t))) + ;; We use a locale, which might not be installed. Check it. + (ignore-errors + (string-collate-equalp + "" "" (if (eq system-type 'windows-nt) "enu_USA" "en_US.UTF-8"))))) + (ert-deftest fns-tests-collate-strings () - ;; When there is no collation library, collation functions fall back - ;; to their lexicographic counterparts. We don't need to test then. - (skip-unless (not (ignore-errors (string-collate-equalp "" "" t)))) + (skip-unless (fns-tests--collate-enabled-p)) (should (string-collate-equalp "xyzzy" "xyzzy")) (should-not (string-collate-equalp "xyzzy" "XYZZY")) @@ -146,6 +155,8 @@ (9 . "aaa") (9 . "zzz") (9 . "ppp") (9 . "fff")]))) (ert-deftest fns-tests-collate-sort () + (skip-unless (fns-tests--collate-enabled-p)) + ;; Punctuation and whitespace characters are relevant for POSIX. (should (equal |