From: Mattias EngdegÄrd Date: Wed, 22 Sep 2021 13:40:29 +0000 (+0200) Subject: Don't rely on lexical-binding being nil in tests X-Git-Tag: emacs-28.0.90~741 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6ad77d36fd3f1a0080157c2064932e100ba6ad88;p=emacs.git Don't rely on lexical-binding being nil in tests * 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. --- diff --git a/test/lisp/button-tests.el b/test/lisp/button-tests.el index e0944afa344..2f5ad795df2 100644 --- a/test/lisp/button-tests.el +++ b/test/lisp/button-tests.el @@ -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)))) diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index aa5150b4b73..b283a512a42 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el @@ -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)))))