emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 6ad77d3: Don't rely on lexical-binding being nil in tests


From: Mattias Engdegård
Subject: master 6ad77d3: Don't rely on lexical-binding being nil in tests
Date: Wed, 22 Sep 2021 09:42:58 -0400 (EDT)

branch: master
commit 6ad77d36fd3f1a0080157c2064932e100ba6ad88
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    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 e0944af..2f5ad79 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 aa5150b..b283a51 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)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]