From: Mattias EngdegÄrd Date: Thu, 24 Jun 2021 18:48:41 +0000 (+0200) Subject: Don't call ERT explainer on error X-Git-Tag: emacs-28.0.90~2039 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1283e1db9b7750a90472e7d557fdd75fcaff6446;p=emacs.git Don't call ERT explainer on error * lisp/emacs-lisp/ert.el (ert--expand-should-1): If the predicate form signals an error, don't call an explainer because the arguments passed (the error and error argument, respectively) do not make any sense to the explainer at all. --- diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 6793b374eea..7de07bd6f53 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -313,12 +313,13 @@ It should only be stopped when ran from inside ert--run-test-internal." (list :form `(,,fn ,@,args)) (unless (eql ,value ',default-value) (list :value ,value)) - (let ((-explainer- - (and (symbolp ',fn-name) - (get ',fn-name 'ert-explainer)))) - (when -explainer- - (list :explanation - (apply -explainer- ,args))))) + (unless (eql ,value ',default-value) + (let ((-explainer- + (and (symbolp ',fn-name) + (get ',fn-name 'ert-explainer)))) + (when -explainer- + (list :explanation + (apply -explainer- ,args)))))) value) ,value))))))))