From: Philipp Stephani Date: Sun, 18 Apr 2021 19:46:10 +0000 (+0200) Subject: Extend project test so that 'project-current' works. X-Git-Tag: emacs-28.0.90~2822 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=55b22bff6d5fc573c2d1e5b05faa12bed5ee4156;p=emacs.git 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. --- diff --git a/test/lisp/progmodes/project-tests.el b/test/lisp/progmodes/project-tests.el index 6e71948477c..829f52adecc 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))))