]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix two tests
authorEli Zaretskii <eliz@gnu.org>
Sat, 16 Jan 2021 18:15:17 +0000 (20:15 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 16 Jan 2021 18:15:17 +0000 (20:15 +0200)
* test/lisp/progmodes/elisp-mode-tests.el (xref-elisp-test-run):
Make sure file names can be compared as strings, by running them
through 'file-truename'.  Reported by Vin Shelton
<acs@alumni.princeton.edu>.
* test/lisp/emacs-lisp/bytecomp-tests.el ("warn-obsolete-hook.el")
("warn-obsolete-variable.el"): Use [^z-a] to match a newline as
well.  Reported by Vin Shelton <acs@alumni.princeton.edu>.

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

index a07af188facd91911963d4df95fc9c8f145de1d0..263736af4edf7c3645c6ee68405c2e3984648c4d 100644 (file)
@@ -617,13 +617,13 @@ Subtests signal errors if something goes wrong."
 (make-obsolete-variable 'bytecomp--tests-obsolete-var nil "99.99")
 
 (bytecomp--define-warning-file-test "warn-obsolete-hook.el"
-                            "bytecomp--tests-obs.*obsolete.*99.99")
+                            "bytecomp--tests-obs.*obsolete[^z-a]*99.99")
 
 (bytecomp--define-warning-file-test "warn-obsolete-variable-same-file.el"
                             "foo-obs.*obsolete.*99.99" t)
 
 (bytecomp--define-warning-file-test "warn-obsolete-variable.el"
-                            "bytecomp--tests-obs.*obsolete.*99.99")
+                            "bytecomp--tests-obs.*obsolete[^z-a]*99.99")
 
 (bytecomp--define-warning-file-test "warn-obsolete-variable-bound.el"
                             "bytecomp--tests-obs.*obsolete.*99.99" t)
index a10d5dab906f9c3be8c34e2c9613a836e4250a92..fd43707f2771985da1e74c807b354ddff49de1f9 100644 (file)
     (let* ((xref (pop xrefs))
            (expected (pop expected-xrefs))
            (expected-xref (or (when (consp expected) (car expected)) expected))
-           (expected-source (when (consp expected) (cdr expected))))
+           (expected-source (when (consp expected) (cdr expected)))
+           (xref-file (xref-elisp-location-file (oref xref location)))
+           (expected-file (xref-elisp-location-file
+                           (oref expected-xref location))))
+
+      ;; Make sure file names compare as strings.
+      (when (file-name-absolute-p xref-file)
+        (setf (xref-elisp-location-file (oref xref location))
+              (file-truename (xref-elisp-location-file (oref xref location)))))
+      (when (file-name-absolute-p expected-file)
+        (setf (xref-elisp-location-file (oref expected-xref location))
+              (file-truename (xref-elisp-location-file
+                              (oref expected-xref location)))))
 
       ;; Downcase the filenames for case-insensitive file systems.
       (when xref--case-insensitive