Don't downcase real xref in elisp-mode-tests
authorRob Browning <rlb@defaultvalue.org>
Sat, 29 Jul 2017 16:50:27 +0000 (11:50 -0500)
committerRob Browning <rlb@defaultvalue.org>
Wed, 26 Dec 2018 19:54:16 +0000 (19:54 +0000)
The elisp-mode-tests should no longer fail on case sensitive
filesystems when the build path contains uppercase characters.

Previously the code was downcasing the path for both comparison and
lookups.

Gbp-Pq: Name 0008-Don-t-downcase-real-xref-in-elisp-mode-tests.patch

test/lisp/progmodes/elisp-mode-tests.el

index 941e85bc890e31b5dc4d58b71b5210e10228f82c..faf45b88ff71220c59f1cc11f25ac3bcfff3a9c1 100644 (file)
 (defun xref-elisp-test-run (xrefs expected-xrefs)
   (should (= (length xrefs) (length expected-xrefs)))
   (while xrefs
-    (let* ((xref (pop xrefs))
+    (let* ((real-xref (pop xrefs))
+           (xref (clone real-xref))
            (expected (pop expected-xrefs))
            (expected-xref (or (when (consp expected) (car expected)) expected))
            (expected-source (when (consp expected) (cdr expected))))
 
+      (setf (oref xref location)
+            (copy-xref-elisp-location (oref xref location)))
+
       ;; Downcase the filenames for case-insensitive file systems.
       (setf (xref-elisp-location-file (oref xref location))
             (downcase (xref-elisp-location-file (oref xref location))))
 
       (should (equal xref expected-xref))
 
-      (xref--goto-location (xref-item-location xref))
+      (xref--goto-location (xref-item-location real-xref))
       (back-to-indentation)
       (should (looking-at (or expected-source
                               (xref-elisp-test-descr-to-target expected)))))