From: Glenn Morris Date: Sat, 22 Jul 2017 01:22:49 +0000 (-0400) Subject: * test/lisp/ibuffer-tests.el: Delete temporary files. X-Git-Tag: emacs-26.0.90~518^2~38 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=959fcb113a4680175db5274efb1e0e23fdd69cfe;p=emacs.git * test/lisp/ibuffer-tests.el: Delete temporary files. --- diff --git a/test/lisp/ibuffer-tests.el b/test/lisp/ibuffer-tests.el index 56b0d36afdc..af75aa0ec7f 100644 --- a/test/lisp/ibuffer-tests.el +++ b/test/lisp/ibuffer-tests.el @@ -150,6 +150,7 @@ ;; 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) @@ -192,6 +193,7 @@ (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))) @@ -213,6 +215,8 @@ (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