From aca235cb94b9b717de6e65b662b878362af26d57 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 7 Nov 2021 22:46:09 +0100 Subject: [PATCH] ; Fix duplicate temporary file creation * test/lisp/files-tests.el (files-tests-executable-find): Fix creating duplicate temporary file after recent change. --- test/lisp/files-tests.el | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index cf9d87f76d7..c6d7c19279b 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el @@ -1383,25 +1383,24 @@ See ." See ." (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 -- 2.39.2