emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master f0d79d2: Fix with-todo-test


From: Glenn Morris
Subject: [Emacs-diffs] master f0d79d2: Fix with-todo-test
Date: Fri, 2 Jun 2017 13:15:56 -0400 (EDT)

branch: master
commit f0d79d2b8d3a8a0b2aa7b39519d1df32f0e335e6
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>

    Fix with-todo-test
    
    * 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 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/test/lisp/calendar/todo-mode-tests.el 
b/test/lisp/calendar/todo-mode-tests.el
index 5e1a22b..08dfe54 100644
--- a/test/lisp/calendar/todo-mode-tests.el
+++ b/test/lisp/calendar/todo-mode-tests.el
@@ -44,13 +44,15 @@
 
 (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.



reply via email to

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