emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 81cac3e9 4/6: Merge from origin/emacs-26


From: Glenn Morris
Subject: [Emacs-diffs] master 81cac3e9 4/6: Merge from origin/emacs-26
Date: Thu, 20 Dec 2018 10:55:30 -0500 (EST)

branch: master
commit 81cac3e9ddb99addcbf5dbc8b8a58b2042db6fa6
Merge: 46e22ae 4c6c327
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>

    Merge from origin/emacs-26
    
    4c6c327 Restrict downcasing in elisp xref tests (bug#25534)
    ab8ed41 Avoid test failures if directory name looks like a regexp
---
 test/lisp/ibuffer-tests.el              |  4 ++--
 test/lisp/net/tramp-tests.el            |  5 +++--
 test/lisp/progmodes/elisp-mode-tests.el | 28 ++++++++++++++++++++--------
 3 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/test/lisp/ibuffer-tests.el b/test/lisp/ibuffer-tests.el
index ff5162f..c1d9ed9 100644
--- a/test/lisp/ibuffer-tests.el
+++ b/test/lisp/ibuffer-tests.el
@@ -312,8 +312,8 @@
                 (funcall create-non-file-buffer "ibuf-test-3.b" :size 50
                          :mode #'text-mode
                          :include-content "...but a multitude of drops?\n"))
-               (dirA (with-current-buffer bufA default-directory))
-               (dirB (with-current-buffer bufB default-directory)))
+               (dirA (regexp-quote (with-current-buffer bufA 
default-directory)))
+               (dirB (regexp-quote (with-current-buffer bufB 
default-directory))))
           (should (ibuffer-included-in-filters-p
                    bufA '((basename . "ibuf-test-3"))))
           (should (ibuffer-included-in-filters-p
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 4a74e8b..8c67687 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -5352,8 +5352,9 @@ process sentinels.  They shall not disturb each other."
      (string-match
       (format
        "Loading %s"
-       (expand-file-name
-       "tramp-cmds" (file-name-directory (locate-library "tramp"))))
+       (regexp-quote
+        (expand-file-name
+         "tramp-cmds" (file-name-directory (locate-library "tramp")))))
       (shell-command-to-string
        (format
        "%s -batch -Q -L %s -l tramp-sh --eval %s"
diff --git a/test/lisp/progmodes/elisp-mode-tests.el 
b/test/lisp/progmodes/elisp-mode-tests.el
index 941e85b..97148ef 100644
--- a/test/lisp/progmodes/elisp-mode-tests.el
+++ b/test/lisp/progmodes/elisp-mode-tests.el
@@ -298,6 +298,16 @@
       )))
 
 
+;; tmp may be on a different filesystem to the tests, but, ehh.
+(defvar xref--case-insensitive
+  (let ((dir (make-temp-file "xref-test" t)))
+    (unwind-protect
+        (progn
+          (with-temp-file (expand-file-name "hElLo" dir) "hello")
+          (file-exists-p (expand-file-name "HELLO" dir)))
+      (delete-directory dir t)))
+  "Non-nil if file system seems to be case-insensitive.")
+
 (defun xref-elisp-test-run (xrefs expected-xrefs)
   (should (= (length xrefs) (length expected-xrefs)))
   (while xrefs
@@ -307,11 +317,13 @@
            (expected-source (when (consp expected) (cdr expected))))
 
       ;; Downcase the filenames for case-insensitive file systems.
-      (setf (xref-elisp-location-file (oref xref location))
-            (downcase (xref-elisp-location-file (oref xref location))))
+      (when xref--case-insensitive
+        (setf (xref-elisp-location-file (oref xref location))
+              (downcase (xref-elisp-location-file (oref xref location))))
 
-      (setf (xref-elisp-location-file (oref expected-xref location))
-            (downcase (xref-elisp-location-file (oref expected-xref 
location))))
+        (setf (xref-elisp-location-file (oref expected-xref location))
+              (downcase (xref-elisp-location-file
+                         (oref expected-xref location)))))
 
       (should (equal xref expected-xref))
 
@@ -346,10 +358,10 @@ to (xref-elisp-test-descr-to-target xref)."
 ;; `load-path' has the correct case, so this causes the expected test
 ;; values to have the wrong case). This is handled in
 ;; `xref-elisp-test-run'.
-(defconst emacs-test-dir
-  (downcase
-   (file-truename (file-name-directory
-                  (or load-file-name (buffer-file-name))))))
+(defvar emacs-test-dir
+  (funcall (if xref--case-insensitive 'downcase 'identity)
+           (file-truename (file-name-directory
+                           (or load-file-name (buffer-file-name))))))
 
 
 ;; alphabetical by test name



reply via email to

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