diff options
| author | Mattias EngdegÄrd | 2021-10-04 18:11:40 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2021-10-04 18:11:40 +0200 |
| commit | 0f2df365592636aaa6bcd72fc662774eb35c69d1 (patch) | |
| tree | 54bcbcbcc279007398b4a445aafbb2557643874a | |
| parent | 10e3bc610b48c18ba5b4a2859a9621a2ee96be48 (diff) | |
| download | emacs-0f2df365592636aaa6bcd72fc662774eb35c69d1.tar.gz emacs-0f2df365592636aaa6bcd72fc662774eb35c69d1.zip | |
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.el | 9 |
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 ...))'. | |||
| 219 | `(:expected-result-type ,expected-result)) | 219 | `(:expected-result-type ,expected-result)) |
| 220 | ,@(when tags-supplied-p | 220 | ,@(when tags-supplied-p |
| 221 | `(:tags ,tags)) | 221 | `(:tags ,tags)) |
| 222 | :body (lambda () | 222 | :body (lambda () ,@body))) |
| 223 | ;; Use the value of `lexical-binding' in | ||
| 224 | ;; the source file when evaluating the body. | ||
| 225 | (let ((lexical-binding ,lexical-binding)) | ||
| 226 | ,@body)))) | ||
| 227 | ',name)))) | 223 | ',name)))) |
| 228 | 224 | ||
| 229 | (defvar ert--find-test-regexp | 225 | (defvar ert--find-test-regexp |
| @@ -780,7 +776,8 @@ This mainly sets up debugger-related bindings." | |||
| 780 | ;; handle ert errors. Once that's done, remove | 776 | ;; handle ert errors. Once that's done, remove |
| 781 | ;; `ert--should-signal-hook'. See Bug#24402 and Bug#11218 for | 777 | ;; `ert--should-signal-hook'. See Bug#24402 and Bug#11218 for |
| 782 | ;; details. | 778 | ;; details. |
| 783 | (let ((debugger (lambda (&rest args) | 779 | (let ((lexical-binding t) |
| 780 | (debugger (lambda (&rest args) | ||
| 784 | (ert--run-test-debugger test-execution-info | 781 | (ert--run-test-debugger test-execution-info |
| 785 | args))) | 782 | args))) |
| 786 | (debug-on-error t) | 783 | (debug-on-error t) |