summaryrefslogtreecommitdiff
path: root/test/lisp/files-tests.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2021-11-06 16:05:02 +0100
committerStefan Kangas <stefan@marxist.se>2021-11-06 19:16:05 +0100
commit83422370c87000f3d6d89320d4947c24325c9ad2 (patch)
tree69c393a2f4272c03324c1dabe5bbf67da2002469 /test/lisp/files-tests.el
parentbf2e35c5d25a8d1ed5ceacfd6171233bc75eae01 (diff)
downloademacs-83422370c87000f3d6d89320d4947c24325c9ad2.tar.gz
Replace some macros with ert-with-temp-(file|directory)
* test/lisp/custom-tests.el (custom-tests--with-temp-dir): * test/lisp/files-tests.el (files-tests--with-temp-file): * test/lisp/progmodes/project-tests.el (project-tests--with-temporary-directory): * test/src/emacs-module-tests.el (module--with-temp-directory): * test/src/emacs-tests.el (emacs-tests--with-temp-file): * test/src/lread-tests.el (lread-tests--with-temp-file): * test/src/process-tests.el (process-tests--with-temp-directory): Replace macros with 'ert-with-temp-(file|directory)'. Update callers.
Diffstat (limited to 'test/lisp/files-tests.el')
-rw-r--r--test/lisp/files-tests.el16
1 files changed, 4 insertions, 12 deletions
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index 4b9d4e45164..f2a6e062acc 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -341,14 +341,6 @@ be $HOME."
(progn ,@body)
(advice-remove #',symbol ,function)))))
-(defmacro files-tests--with-temp-file (name &rest body)
- (declare (indent 1) (debug (symbolp body)))
- (cl-check-type name symbol)
- `(let ((,name (make-temp-file "emacs")))
- (unwind-protect
- (progn ,@body)
- (delete-file ,name))))
-
(ert-deftest files-tests-file-name-non-special--buffers ()
"Check that Bug#25951 is fixed.
We call `verify-visited-file-modtime' on a buffer visiting a file
@@ -357,7 +349,7 @@ the buffer current and a nil argument, second passing the buffer
object explicitly. In both cases no error should be raised and
the `file-name-non-special' handler for quoted file names should
be invoked with the right arguments."
- (files-tests--with-temp-file temp-file-name
+ (ert-with-temp-file temp-file-name
(with-temp-buffer
(let* ((buffer-visiting-file (current-buffer))
(actual-args ())
@@ -1318,7 +1310,7 @@ name (Bug#28412)."
(set-buffer-modified-p t)
(should-error (save-buffer) :type 'error))
;; Then a buffer visiting a file: should save normally.
- (files-tests--with-temp-file temp-file-name
+ (ert-with-temp-file temp-file-name
(with-current-buffer (find-file-noselect temp-file-name)
(setq write-contents-functions nil)
(insert "p")
@@ -1509,7 +1501,7 @@ The door of all subtleties!
(ert-deftest files-tests-revert-buffer ()
"Test that revert-buffer is successful."
- (files-tests--with-temp-file temp-file-name
+ (ert-with-temp-file temp-file-name
(with-temp-buffer
(insert files-tests-lao)
(write-file temp-file-name)
@@ -1522,7 +1514,7 @@ The door of all subtleties!
(ert-deftest files-tests-revert-buffer-with-fine-grain ()
"Test that revert-buffer-with-fine-grain is successful."
- (files-tests--with-temp-file temp-file-name
+ (ert-with-temp-file temp-file-name
(with-temp-buffer
(insert files-tests-lao)
(write-file temp-file-name)