]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't rely on lexical-binding being nil in tests
authorMattias Engdegård <mattiase@acm.org>
Wed, 22 Sep 2021 13:40:29 +0000 (15:40 +0200)
committerMattias Engdegård <mattiase@acm.org>
Wed, 22 Sep 2021 13:42:41 +0000 (15:42 +0200)
* test/lisp/button-tests.el (button--help-echo-form):
* test/lisp/files-tests.el (files-tests-permanent-local-variables):
Remove assumption that `with-temp-buffer` creates a buffer
where `lexical-binding` is nil.

test/lisp/button-tests.el
test/lisp/files-tests.el

index e0944afa344bb31f5ce9cb127b028dc260ee3e1d..2f5ad795df2fece9796e77d53e75a5746ea0ee59 100644 (file)
@@ -59,6 +59,7 @@
   "Test `button--help-echo' with forms."
   (with-temp-buffer
     ;; Test text property buttons with dynamic scoping.
+    (setq lexical-binding nil)
     (let* ((help   (make-symbol "help"))
            (form   `(funcall (let ((,help "lexical form"))
                                (lambda () ,help))))
index aa5150b4b73e11fb99f0caaf3c39f573cd53d236..b283a512a42b6d63b750b0669fcef53adec5be19 100644 (file)
@@ -154,12 +154,14 @@ form.")
 (ert-deftest files-tests-permanent-local-variables ()
   (let ((enable-local-variables nil))
     (with-temp-buffer
+      (setq lexical-binding nil)
       (insert ";;; test-test.el --- tests  -*- lexical-binding: t; -*-\n\n")
       (hack-local-variables)
       (should (eq lexical-binding t))))
   (let ((enable-local-variables nil)
         (permanently-enabled-local-variables nil))
     (with-temp-buffer
+      (setq lexical-binding nil)
       (insert ";;; test-test.el --- tests  -*- lexical-binding: t; -*-\n\n")
       (hack-local-variables)
       (should (eq lexical-binding nil)))))