]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix duplicate temporary file creation
authorStefan Kangas <stefan@marxist.se>
Sun, 7 Nov 2021 21:46:09 +0000 (22:46 +0100)
committerStefan Kangas <stefan@marxist.se>
Sun, 7 Nov 2021 23:47:09 +0000 (00:47 +0100)
* test/lisp/files-tests.el (files-tests-executable-find): Fix creating
duplicate temporary file after recent change.

test/lisp/files-tests.el

index cf9d87f76d7f66de3790eedd14659c5f290df3ca..c6d7c19279b2b751e5c0762c6780868f59c24cc3 100644 (file)
@@ -1383,25 +1383,24 @@ See <https://debbugs.gnu.org/19657#20>."
 See <https://debbugs.gnu.org/35241>."
   (ert-with-temp-file tmpfile
     :suffix (car exec-suffixes)
-    (let ((tmpfile (make-temp-file "files-test" nil )))
-      (set-file-modes tmpfile #o777)
-      (let ((exec-path `(,temporary-file-directory)))
-        (should
-         (equal tmpfile
-                (executable-find (file-name-nondirectory tmpfile)))))
-      ;; An empty element of `exec-path' means `default-directory'.
-      (let ((default-directory temporary-file-directory)
-            (exec-path nil))
-        (should
-         (equal tmpfile
-                (executable-find (file-name-nondirectory tmpfile)))))
-      ;; The remote file name shall be quoted, and handled like a
-      ;; non-existing directory.
-      (let ((default-directory "/ssh::")
-            (exec-path (append exec-path `("." ,temporary-file-directory))))
-        (should
-         (equal tmpfile
-                (executable-find (file-name-nondirectory tmpfile))))))))
+    (set-file-modes tmpfile #o755)
+    (let ((exec-path `(,temporary-file-directory)))
+      (should
+       (equal tmpfile
+              (executable-find (file-name-nondirectory tmpfile)))))
+    ;; An empty element of `exec-path' means `default-directory'.
+    (let ((default-directory temporary-file-directory)
+          (exec-path nil))
+      (should
+       (equal tmpfile
+              (executable-find (file-name-nondirectory tmpfile)))))
+    ;; The remote file name shall be quoted, and handled like a
+    ;; non-existing directory.
+    (let ((default-directory "/ssh::")
+          (exec-path (append exec-path `("." ,temporary-file-directory))))
+      (should
+       (equal tmpfile
+              (executable-find (file-name-nondirectory tmpfile)))))))
 
 (ert-deftest files-tests-dont-rewrite-precious-files ()
   "Test that `file-precious-flag' forces files to be saved by