]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve ffap-ido-mode test
authordickmao <none>
Fri, 6 Aug 2021 11:29:31 +0000 (13:29 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 6 Aug 2021 11:29:31 +0000 (13:29 +0200)
* test/lisp/ffap-tests.el (ffap-ido-mode): Actually test
`ido-everywhere' at run time, not compile time (bug#49895).

test/lisp/ffap-tests.el

index 4fb4c90e76d68777a9a2ce0337bebc0a826c2178..f8113bffc1a8712a2556a08ce784cb038d74218a 100644 (file)
@@ -127,13 +127,17 @@ left alone when opening a URL in an external browser."
   (require 'ido)
   (with-temp-buffer
     (let ((ido-mode t)
-          (read-filename-function read-file-name-function)
+          (read-file-name-function read-file-name-function)
           (read-buffer-function read-buffer-function))
-      (ido-everywhere)
+      ;; Says ert-deftest:
+      ;; Macros in BODY are expanded when the test is defined, not when it
+      ;; is run.  If a macro (possibly with side effects) is to be tested,
+      ;; it has to be wrapped in `(eval (quote ...))'.
+      (eval (quote (ido-everywhere)))
       (let ((read-file-name-function (lambda (&rest args)
-                                     (expand-file-name
-                                      (nth 4 args)
-                                      (nth 1 args)))))
+                                       (expand-file-name
+                                        (nth 4 args)
+                                        (nth 1 args)))))
         (save-excursion (insert "ffap-tests.el"))
         (let (kill-buffer-query-functions)
           (kill-buffer (call-interactively #'find-file-at-point)))))))