From 6ad77d36fd3f1a0080157c2064932e100ba6ad88 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= Date: Wed, 22 Sep 2021 15:40:29 +0200 Subject: [PATCH] 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. --- test/lisp/button-tests.el | 1 + test/lisp/files-tests.el | 2 ++ 2 files changed, 3 insertions(+) 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))))) -- 2.39.5