]> git.eshelyaron.com Git - emacs.git/commit
Use ambient lexical-binding value in ert-deftest body (bug#50738)
authorMattias Engdegård <mattiase@acm.org>
Thu, 23 Sep 2021 12:02:21 +0000 (14:02 +0200)
committerMattias Engdegård <mattiase@acm.org>
Sat, 25 Sep 2021 18:25:01 +0000 (20:25 +0200)
commit0b099e34dc726c3ed0e7b63028f42c2a2720ba7c
tree4e6c5463ac3f8388286d4508fba4046631822f8d
parented02b88bbae18caad650d76876940ffb58cab554
Use ambient lexical-binding value in ert-deftest body (bug#50738)

* lisp/emacs-lisp/ert.el (ert-deftest):
Evaluate the body of `ert-deftest` with the `lexical-binding` value of
the source file (or more precisely the value in force when the
definition is evaluated), which is what everyone expected, instead of
always using dynamic binding which is what they got until now.
* test/lisp/emacs-lisp/ert-tests.el
(ert-test-deftest-lexical-binding-t): New test.
lisp/emacs-lisp/ert.el
test/lisp/emacs-lisp/ert-tests.el