]> git.eshelyaron.com Git - emacs.git/commitdiff
* test/lisp/ibuffer-tests.el: Delete temporary files.
authorGlenn Morris <rgm@gnu.org>
Sat, 22 Jul 2017 01:22:49 +0000 (21:22 -0400)
committerGlenn Morris <rgm@gnu.org>
Sat, 22 Jul 2017 01:22:49 +0000 (21:22 -0400)
test/lisp/ibuffer-tests.el

index 56b0d36afdc01fd5feddf97f9808f714f2172839..af75aa0ec7fef95edae426d9ea95585833d291dd 100644 (file)
 
 ;; Test Filter Inclusion
 (let* (test-buffer-list  ; accumulated buffers to clean up
+       test-file-list
        ;; Utility functions without polluting the environment
        (set-buffer-mode
         (lambda (buffer mode)
                  (file    (make-temp-file prefix nil suffix))
                  (buf     (find-file-noselect file t)))
             (push buf test-buffer-list) ; record for cleanup
+            (push file test-file-list)
             (funcall set-buffer-mode buf mode)
             (funcall set-buffer-contents buf size include)
             buf)))
        (clean-up
         (lambda ()
           "Restore all emacs state modified during the tests"
+          (dolist (f test-file-list)
+            (and f (file-exists-p f) (delete-file f)))
           (while test-buffer-list       ; created temporary buffers
             (let ((buf (pop test-buffer-list)))
               (with-current-buffer buf (bury-buffer)) ; ensure not selected