]> git.eshelyaron.com Git - emacs.git/commitdiff
Ensure the created temp file in a test is new
authorTino Calancha <tino.calancha@gmail.com>
Sat, 6 May 2017 03:30:48 +0000 (12:30 +0900)
committerTino Calancha <tino.calancha@gmail.com>
Sat, 6 May 2017 03:30:48 +0000 (12:30 +0900)
* test/lisp/buff-menu-tests.el (buff-menu-24962): Use `make-temp-file'
to create the temp file.

test/lisp/buff-menu-tests.el

index 43214f250607baf1c89daaff1d8d31cc4c7cf35e..21ffb2ebf361c0c7e685346a4fe75b1cc374ab3a 100644 (file)
 
 (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*"