summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2021-10-04 18:11:40 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2021-10-04 18:11:40 +0200
commit0f2df365592636aaa6bcd72fc662774eb35c69d1 (patch)
tree54bcbcbcc279007398b4a445aafbb2557643874a
parent10e3bc610b48c18ba5b4a2859a9621a2ee96be48 (diff)
downloademacs-0f2df365592636aaa6bcd72fc662774eb35c69d1.tar.gz
Run ERT tests with `lexical-binding` bound to `t`
* lisp/emacs-lisp/ert.el (ert-deftest, ert--run-test-internal): Use t rather than the ambient file value for `lexical-binding` to avoid bad lexbind coverage by mistake.
-rw-r--r--lisp/emacs-lisp/ert.el9
1 files changed, 3 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index f2b20fd74e5..607f15d254f 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -219,11 +219,7 @@ it has to be wrapped in `(eval (quote ...))'.
`(:expected-result-type ,expected-result))
,@(when tags-supplied-p
`(:tags ,tags))
- :body (lambda ()
- ;; Use the value of `lexical-binding' in
- ;; the source file when evaluating the body.
- (let ((lexical-binding ,lexical-binding))
- ,@body))))
+ :body (lambda () ,@body)))
',name))))
(defvar ert--find-test-regexp
@@ -780,7 +776,8 @@ This mainly sets up debugger-related bindings."
;; handle ert errors. Once that's done, remove
;; `ert--should-signal-hook'. See Bug#24402 and Bug#11218 for
;; details.
- (let ((debugger (lambda (&rest args)
+ (let ((lexical-binding t)
+ (debugger (lambda (&rest args)
(ert--run-test-debugger test-execution-info
args)))
(debug-on-error t)