]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix 2 testsuite tests for MS-Windows
authorEli Zaretskii <eliz@gnu.org>
Wed, 20 Sep 2017 07:16:11 +0000 (10:16 +0300)
committerEli Zaretskii <eliz@gnu.org>
Wed, 20 Sep 2017 07:16:11 +0000 (10:16 +0300)
* test/lisp/ibuffer-tests.el (test-buffer-list): Don't try to
create files with "*" in their names.
* test/src/editfns-tests.el (format-time-string-with-zone): Adapt
results to MS-Windows build.  Reported by Fabrice Popineau
<fabrice.popineau@gmail.com>.

test/lisp/ibuffer-tests.el
test/src/editfns-tests.el

index d65acf60712cf0a516c971dc045acf6ce5ed1991..35605ca28dc53711ff9adf643bd32d4f71e646cd 100644 (file)
                (funcall create-non-file-buffer "ibuf-test-8a"
                         :mode #'artist-mode))
               (bufB (funcall create-non-file-buffer "*ibuf-test-8b*" :size 32))
-              (bufC (funcall create-file-buffer "ibuf-test8c" :suffix "*"
-                             :size 64))
-              (bufD (funcall create-file-buffer "*ibuf-test8d" :size 128))
-              (bufE (funcall create-file-buffer "*ibuf-test8e" :suffix "*<2>"
-                             :size 16))
+              (bufC (or (memq system-type '(ms-dos windows-nt))
+                        (funcall create-file-buffer "ibuf-test8c" :suffix "*"
+                                 :size 64)))
+              (bufD (or (memq system-type '(ms-dos windows-nt))
+                        (funcall create-file-buffer "*ibuf-test8d" :size 128)))
+              (bufE (or (memq system-type '(ms-dos windows-nt))
+                        (funcall create-file-buffer "*ibuf-test8e"
+                                 :suffix "*<2>" :size 16)))
               (bufF (and (funcall create-non-file-buffer "*ibuf-test8f*")
                          (funcall create-non-file-buffer "*ibuf-test8f*"
                                   :size 8))))
                                (name . "test.*8b")
                                (size-gt . 31)
                                (not visiting-file)))))
-          (should (ibuffer-included-in-filters-p
-                   bufC '((and (not (starred-name))
-                               (visiting-file)
-                               (name . "8c[^*]*\\*")
-                               (size-lt . 65)))))
-          (should (ibuffer-included-in-filters-p
-                   bufD '((and (not (starred-name))
-                               (visiting-file)
-                               (name . "\\`\\*.*test8d")
-                               (size-lt . 129)
-                               (size-gt . 127)))))
-          (should (ibuffer-included-in-filters-p
-                   bufE '((and (starred-name)
-                               (visiting-file)
-                               (name . "8e.*?\\*<[[:digit:]]+>")
-                               (size-gt . 10)))))
+          ;; MS-DOS and MS-Windows don't allow "*" in file names.
+          (or (memq system-type '(ms-dos windows-nt))
+              (should (ibuffer-included-in-filters-p
+                       bufC '((and (not (starred-name))
+                                   (visiting-file)
+                                   (name . "8c[^*]*\\*")
+                                   (size-lt . 65))))))
+          ;; MS-DOS and MS-Windows don't allow "*" in file names.
+          (or (memq system-type '(ms-dos windows-nt))
+              (should (ibuffer-included-in-filters-p
+                       bufD '((and (not (starred-name))
+                                   (visiting-file)
+                                   (name . "\\`\\*.*test8d")
+                                   (size-lt . 129)
+                                   (size-gt . 127))))))
+          ;; MS-DOS and MS-Windows don't allow "*" in file names.
+          (or (memq system-type '(ms-dos windows-nt))
+              (should (ibuffer-included-in-filters-p
+                       bufE '((and (starred-name)
+                                   (visiting-file)
+                                   (name . "8e.*?\\*<[[:digit:]]+>")
+                                   (size-gt . 10))))))
           (should (ibuffer-included-in-filters-p
                    bufF '((and (starred-name)
                                (not (visiting-file))
index f910afaf7118f68de6f48f8d3ef4b72dd1f2dd47..70dc9372fad18380287e8a518cc5a9039030f014 100644 (file)
     ;; Negative UTC offset, as a Lisp integer.
     (should (string-equal
              (format-time-string format look -28800)
-             "1972-06-30 15:59:59.999 -0800 (-08)"))
+             ;; MS-Windows build replaces unrecognizable TZ values,
+             ;; such as "-08", with "ZZZ".
+             (if (eq system-type 'windows-nt)
+                 "1972-06-30 15:59:59.999 -0800 (ZZZ)"
+               "1972-06-30 15:59:59.999 -0800 (-08)")))
     ;; Positive UTC offset that is not an hour multiple, as a string.
     (should (string-equal
              (format-time-string format look "IST-5:30")