]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix the tests
authorDmitry Gutov <dgutov@yandex.ru>
Mon, 13 Sep 2021 12:47:45 +0000 (15:47 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Mon, 13 Sep 2021 12:47:45 +0000 (15:47 +0300)
* test/lisp/progmodes/xref-tests.el
(xref--xref-file-name-display-is-abs)
(xref--xref-file-name-display-is-nondirectory)
(xref--xref-file-name-display-is-relative-to-project-root):
Update for the latest change in xref.el.

test/lisp/progmodes/xref-tests.el

index ff4b647ae0f50935eeae1259dc9b48ad9154d39f..b1de1a4df5af784d8592b2fa517bf6c4581c107a 100644 (file)
   (let ((xref-file-name-display 'abs))
     (should (equal
              (delete-dups
-              (mapcar 'xref-location-group
-                      (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)")))
+              (mapcar
+               (lambda (loc)
+                 (xref--group-name-for-display
+                  (xref-location-group loc)
+                  nil))
+               (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)")))
              (list
               (concat xref-tests--data-dir "file1.txt")
               (concat xref-tests--data-dir "file2.txt"))))))
 (ert-deftest xref--xref-file-name-display-is-nondirectory ()
   (let ((xref-file-name-display 'nondirectory))
     (should (equal (delete-dups
-                    (mapcar 'xref-location-group
-                            (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)")))
+                    (mapcar
+                     (lambda (loc)
+                       (xref--group-name-for-display
+                        (xref-location-group loc)
+                        nil))
+                     (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)")))
                    (list
                     "file1.txt"
                     "file2.txt")))))
 (ert-deftest xref--xref-file-name-display-is-relative-to-project-root ()
   (let* ((data-parent-dir
           (file-name-directory (directory-file-name xref-tests--data-dir)))
-         (project-find-functions
-          (lambda (_) (cons 'transient data-parent-dir)))
          (xref-file-name-display 'project-relative))
     (should (equal
              (delete-dups
-              (mapcar 'xref-location-group
-                      (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)")))
+              (mapcar
+               (lambda (loc)
+                 (xref--group-name-for-display
+                  (xref-location-group loc)
+                  data-parent-dir))
+               (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)")))
              (list
               "xref-resources/file1.txt"
               "xref-resources/file2.txt")))))