]> git.eshelyaron.com Git - emacs.git/commitdiff
Stop esh-var-tests leaving temp files behind
authorGlenn Morris <rgm@gnu.org>
Wed, 4 May 2022 22:02:40 +0000 (15:02 -0700)
committerGlenn Morris <rgm@gnu.org>
Wed, 4 May 2022 22:02:40 +0000 (15:02 -0700)
* test/lisp/eshell/esh-var-tests.el
(esh-var-test/quoted-interp-temp-cmd): Don't leave temporary files.

test/lisp/eshell/esh-var-tests.el

index 3f3b591c5aee97496b1a0174bd640cdd0fcf95ba..4e2a18861e50692752aef8fa6881989c45ef731b 100644 (file)
@@ -333,7 +333,12 @@ inside double-quotes"
 
 (ert-deftest esh-var-test/quoted-interp-temp-cmd ()
   "Interpolate command result redirected to temp file inside double-quotes"
-  (should (equal (eshell-test-command-result "cat \"$<echo hi>\"") "hi")))
+  (let ((temporary-file-directory
+         (file-name-as-directory (make-temp-file "esh-vars-tests" t))))
+    (unwind-protect
+        (should (equal (eshell-test-command-result "cat \"$<echo hi>\"")
+                       "hi"))
+      (delete-directory temporary-file-directory t))))
 
 (ert-deftest esh-var-test/quoted-interp-concat-cmd ()
   "Interpolate and concat command with literal"