aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGlenn Morris2017-08-14 17:23:18 -0400
committerGlenn Morris2017-08-14 17:23:18 -0400
commit4fe9a9efcfdd39c5751d4506e94afaf28fcbcaef (patch)
tree939d688bccb91166dac29d57cfa88d6e27c8096d /test
parent5ba4c7d16b800864fa14b8a981e33f6aa6fa94d6 (diff)
downloademacs-4fe9a9efcfdd39c5751d4506e94afaf28fcbcaef.tar.gz
emacs-4fe9a9efcfdd39c5751d4506e94afaf28fcbcaef.zip
Clean up temp files after some tests
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--with-temp-file): Also delete .elc file if present. * test/lisp/progmodes/etags-tests.el (etags-buffer-local-tags-table-list): Delete temp file at end.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/bytecomp-tests.el4
-rw-r--r--test/lisp/progmodes/etags-tests.el27
2 files changed, 18 insertions, 13 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index 8ef2ce70251..ab70b3009e4 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -512,7 +512,9 @@ bytecompiled code, and their results compared.")
512 `(let ((,file-name-var (make-temp-file "emacs"))) 512 `(let ((,file-name-var (make-temp-file "emacs")))
513 (unwind-protect 513 (unwind-protect
514 (progn ,@body) 514 (progn ,@body)
515 (delete-file ,file-name-var)))) 515 (delete-file ,file-name-var)
516 (let ((elc (concat ,file-name-var ".elc")))
517 (if (file-exists-p elc) (delete-file elc))))))
516 518
517(ert-deftest bytecomp-tests--unescaped-char-literals () 519(ert-deftest bytecomp-tests--unescaped-char-literals ()
518 "Check that byte compiling warns about unescaped character 520 "Check that byte compiling warns about unescaped character
diff --git a/test/lisp/progmodes/etags-tests.el b/test/lisp/progmodes/etags-tests.el
index 0153f327ba8..845f3fe76a8 100644
--- a/test/lisp/progmodes/etags-tests.el
+++ b/test/lisp/progmodes/etags-tests.el
@@ -96,15 +96,18 @@
96(ert-deftest etags-buffer-local-tags-table-list () 96(ert-deftest etags-buffer-local-tags-table-list ()
97 "Test that a buffer-local value of `tags-table-list' is used." 97 "Test that a buffer-local value of `tags-table-list' is used."
98 (let ((file (make-temp-file "etag-test-tmpfile"))) 98 (let ((file (make-temp-file "etag-test-tmpfile")))
99 (set-buffer (find-file-noselect file)) 99 (unwind-protect
100 (fundamental-mode) 100 (progn
101 (setq-local tags-table-list 101 (set-buffer (find-file-noselect file))
102 (list (expand-file-name "manual/etags/ETAGS.good_3" 102 (fundamental-mode)
103 etags-tests--test-dir))) 103 (setq-local tags-table-list
104 (cl-letf ((tag-tables tags-table-list) 104 (list (expand-file-name "manual/etags/ETAGS.good_3"
105 (tags-file-name nil) 105 etags-tests--test-dir)))
106 ((symbol-function 'read-file-name) 106 (cl-letf ((tag-tables tags-table-list)
107 (lambda (&rest _) 107 (tags-file-name nil)
108 (error "We should not prompt the user")))) 108 ((symbol-function 'read-file-name)
109 (should (visit-tags-table-buffer)) 109 (lambda (&rest _)
110 (should (equal tags-file-name (car tag-tables)))))) 110 (error "We should not prompt the user"))))
111 (should (visit-tags-table-buffer))
112 (should (equal tags-file-name (car tag-tables)))))
113 (delete-file file))))