summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/ert.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/ert.el')
-rw-r--r--lisp/emacs-lisp/ert.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index d4d8510064a..6d867abd7a2 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -218,7 +218,11 @@ it has to be wrapped in `(eval (quote ...))'.
`(:expected-result-type ,expected-result))
,@(when tags-supplied-p
`(:tags ,tags))
- :body (lambda () ,@body)))
+ :body (lambda ()
+ ;; Use the value of `lexical-binding' in
+ ;; the source file when evaluating the body.
+ (let ((lexical-binding ,lexical-binding))
+ ,@body))))
',name))))
(defvar ert--find-test-regexp