]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix with-todo-test
authorGlenn Morris <rgm@gnu.org>
Fri, 2 Jun 2017 17:14:44 +0000 (13:14 -0400)
committerGlenn Morris <rgm@gnu.org>
Fri, 2 Jun 2017 17:14:44 +0000 (13:14 -0400)
* test/lisp/calendar/todo-mode-tests.el (with-todo-test):
HOME should be a directory, not a file.  Delete it when finished.

test/lisp/calendar/todo-mode-tests.el

index 5e1a22b37be3113ea29c0eaf1a68f3607209dbd0..08dfe54192961e3d1a3cce49685e958cb784f9ed 100644 (file)
 
 (defmacro with-todo-test (&rest body)
   "Set up an isolated todo-mode test environment."
-  `(let* ((todo-test-home (make-temp-file "todo-test-home-"))
+  `(let* ((todo-test-home (make-temp-file "todo-test-home-" t))
           (process-environment (cons (format "HOME=%s" todo-test-home)
                                      process-environment))
           (todo-directory todo-test-data-dir)
           (todo-default-todo-file (todo-short-file-name
                                   (car (funcall todo-files-function)))))
-     ,@body))
+     (unwind-protect
+         (progn ,@body)
+       (delete-directory todo-test-home t))))
 
 ;; (defun todo-test-show (num &optional archive)
 ;;   "Display category NUM of test todo file.