emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117830: * automated/fns-tests.el (fns-tests--collat


From: Michael Albinus
Subject: [Emacs-diffs] trunk r117830: * automated/fns-tests.el (fns-tests--collate-enabled-p): New function.
Date: Sun, 07 Sep 2014 08:24:56 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117830
revision-id: address@hidden
parent: address@hidden
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Sun 2014-09-07 10:24:44 +0200
message:
  * automated/fns-tests.el (fns-tests--collate-enabled-p): New function.
  (fns-tests-collate-strings, fns-tests-collate-sort): Use it.
modified:
  test/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-8588
  test/automated/fns-tests.el    fnstests.el-20140515083159-ls2r7gfl9o74ajzm-1
=== modified file 'test/ChangeLog'
--- a/test/ChangeLog    2014-09-05 13:32:55 +0000
+++ b/test/ChangeLog    2014-09-07 08:24:44 +0000
@@ -1,3 +1,8 @@
+2014-09-07  Michael Albinus  <address@hidden>
+
+       * 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  <address@hidden>
 
        * automated/fns-tests.el (fns-tests-compare-strings): In case

=== modified file 'test/automated/fns-tests.el'
--- a/test/automated/fns-tests.el       2014-09-05 13:32:55 +0000
+++ b/test/automated/fns-tests.el       2014-09-07 08:24:44 +0000
@@ -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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]