]> git.eshelyaron.com Git - emacs.git/commitdiff
Clean up a test file in /tmp
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 24 May 2022 14:11:01 +0000 (16:11 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 24 May 2022 14:11:09 +0000 (16:11 +0200)
* test/src/buffer-tests.el (test-restore-buffer-modified-p): Clean
up autosave file in /tmp.

test/src/buffer-tests.el

index f6a18acaa6468bd936f11a0ad87cec04b08d0c00..13d48b31a4f07eb3b34cfb29fbbd1a835725098a 100644 (file)
@@ -1515,7 +1515,11 @@ with parameters from the *Messages* buffer modification."
       (should (eq (buffer-modified-p) 'autosaved))
       (insert "zot")
       (restore-buffer-modified-p 'autosaved)
-      (should (eq (buffer-modified-p) 'autosaved))))
+      (should (eq (buffer-modified-p) 'autosaved))
+
+      ;; Clean up.
+      (when (file-exists-p buffer-auto-save-file-name)
+        (delete-file buffer-auto-save-file-name))))
 
   (ert-with-temp-file file
     (with-current-buffer (find-file file)