From 53edda63b17b1f468d957ca67506b2b2c2ddef1e Mon Sep 17 00:00:00 2001
From: Rob Browning <rlb@defaultvalue.org>
Date: Sat, 29 Jul 2017 11:50:27 -0500
Subject: Don't downcase real xref in elisp-mode-tests

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.
---
 test/lisp/progmodes/elisp-mode-tests.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/test/lisp/progmodes/elisp-mode-tests.el b/test/lisp/progmodes/elisp-mode-tests.el
index 2ba00656862..f4076574a72 100644
--- a/test/lisp/progmodes/elisp-mode-tests.el
+++ b/test/lisp/progmodes/elisp-mode-tests.el
@@ -311,11 +311,15 @@ xref--case-insensitive
 (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.
       (when xref--case-insensitive
         (setf (xref-elisp-location-file (oref xref location))
@@ -327,7 +331,7 @@ xref-elisp-test-run
 
       (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)))))
