aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias EngdegÄrd2023-08-14 16:48:05 +0200
committerMattias EngdegÄrd2023-08-14 17:03:44 +0200
commit33bcd4f2d28a7101dbc0ea5563e99cd7f117e21b (patch)
tree24d1bb2adc0715038048af9033235602128aaf5a
parent31ee2ad5ac609db73052aee3c37a326693b2f70f (diff)
downloademacs-33bcd4f2d28a7101dbc0ea5563e99cd7f117e21b.tar.gz
emacs-33bcd4f2d28a7101dbc0ea5563e99cd7f117e21b.zip
Ignore ert-deftest body value
* lisp/emacs-lisp/ert.el (ert-deftest): Since the return value of the body isn't going to be used, ignore it explicitly so that the compiler can warn if we try to return something anyway. In particular, this exposes some comparisons whose result weren't actually checked.
-rw-r--r--lisp/emacs-lisp/ert.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index be9f013ebcf..4ea894f4ede 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -237,7 +237,9 @@ in batch mode, an error is signaled.
237 `(:expected-result-type ,expected-result)) 237 `(:expected-result-type ,expected-result))
238 ,@(when tags-supplied-p 238 ,@(when tags-supplied-p
239 `(:tags ,tags)) 239 `(:tags ,tags))
240 :body (lambda () ,@body) 240 ;; Add `nil' after the body to enable compiler warnings
241 ;; about unused computations at the end.
242 :body (lambda () ,@body nil)
241 :file-name ,(or (macroexp-file-name) buffer-file-name))) 243 :file-name ,(or (macroexp-file-name) buffer-file-name)))
242 ',name)))) 244 ',name))))
243 245