emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 55b22bf 2/4: Extend project test so that 'project-current' works.


From: Philipp Stephani
Subject: master 55b22bf 2/4: Extend project test so that 'project-current' works.
Date: Sun, 18 Apr 2021 16:01:46 -0400 (EDT)

branch: master
commit 55b22bff6d5fc573c2d1e5b05faa12bed5ee4156
Author: Philipp Stephani <phst@google.com>
Commit: Philipp Stephani <phst@google.com>

    Extend project test so that 'project-current' works.
    
    * test/lisp/progmodes/project-tests.el (project/quoted-directory):
    Verify that 'project-current' returns the right project.
---
 test/lisp/progmodes/project-tests.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/test/lisp/progmodes/project-tests.el 
b/test/lisp/progmodes/project-tests.el
index 6e71948..829f52a 100644
--- a/test/lisp/progmodes/project-tests.el
+++ b/test/lisp/progmodes/project-tests.el
@@ -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))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]