]> git.eshelyaron.com Git - emacs.git/commitdiff
Extend project test so that 'project-current' works.
authorPhilipp Stephani <phst@google.com>
Sun, 18 Apr 2021 19:46:10 +0000 (21:46 +0200)
committerPhilipp Stephani <phst@google.com>
Sun, 18 Apr 2021 19:59:25 +0000 (21:59 +0200)
* test/lisp/progmodes/project-tests.el (project/quoted-directory):
Verify that 'project-current' returns the right project.

test/lisp/progmodes/project-tests.el

index 6e71948477c53fc6def8340af9d0962a4506a8ab..829f52adeccd0365549b36bf9890f7a88353ead2 100644 (file)
@@ -35,9 +35,16 @@ names (Bug#47799)."
   (skip-unless (executable-find find-program))
   (let ((directory (make-temp-file "project-tests-" :directory)))
     (unwind-protect
-        (let ((project (cons 'transient (file-name-quote directory)))
+        (let ((default-directory directory)
+              (project-current-inhibit-prompt t)
+              (project-find-functions nil)
+              (project-list-file
+               (expand-file-name "projects" directory))
+              (project (cons 'transient (file-name-quote directory)))
               (file (expand-file-name "file" directory)))
           (make-empty-file file)
+          (add-hook 'project-find-functions (lambda (_dir) project))
+          (should (eq (project-current) project))
           (should (equal (project-files project)
                          (list (file-name-quote file)))))
       (delete-directory directory :recursive))))