From 966020bc52d26274e950b1d7c7e2072735db699b Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Sat, 6 May 2017 12:30:48 +0900 Subject: [PATCH] Ensure the created temp file in a test is new * test/lisp/buff-menu-tests.el (buff-menu-24962): Use `make-temp-file' to create the temp file. --- test/lisp/buff-menu-tests.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/lisp/buff-menu-tests.el b/test/lisp/buff-menu-tests.el index 43214f25060..21ffb2ebf36 100644 --- a/test/lisp/buff-menu-tests.el +++ b/test/lisp/buff-menu-tests.el @@ -27,12 +27,10 @@ (ert-deftest buff-menu-24962 () "Test for http://debbugs.gnu.org/24962 ." - (let ((file (expand-file-name "foo" temporary-file-directory)) - buf) + (let* ((file (make-temp-file "foo")) + (buf (find-file file))) (unwind-protect (progn - (write-region "foo" nil file) - (setq buf (find-file file)) (rename-buffer " foo") (list-buffers) (with-current-buffer "*Buffer List*" -- 2.39.2