]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer setq-local in tests
authorStefan Kangas <stefan@marxist.se>
Tue, 8 Dec 2020 07:57:22 +0000 (08:57 +0100)
committerStefan Kangas <stefan@marxist.se>
Tue, 8 Dec 2020 07:57:22 +0000 (08:57 +0100)
* test/lisp/allout-tests.el (allout-test-resumption-prior-value-resumed)
(allout-test-resumption-multiple-holds)
(allout-test-resumption-unbinding):
* test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el
(faceup-test-mode):
* test/lisp/epg-tests.el (with-epg-tests):
* test/src/data-tests.el (binding-test-buffer-A): Prefer setq-local.

test/lisp/allout-tests.el
test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el
test/lisp/epg-tests.el
test/src/data-tests.el

index f7cd6db9cd41d388d919629c1761e4652bbf6420..c979d085c897ae3488ccccaeeec1f6fc18ca747a 100644 (file)
@@ -74,7 +74,7 @@
   "Ensure that prior local value is resumed."
   (with-temp-buffer
     (allout-tests-obliterate-variable 'allout-tests-locally-true)
-    (set (make-local-variable 'allout-tests-locally-true) t)
+    (setq-local allout-tests-locally-true t)
     (cl-assert (not (default-boundp 'allout-tests-locally-true))
                nil (concat "Test setup mistake -- variable supposed to"
                            " not have global binding, but it does."))
@@ -98,7 +98,7 @@
     (allout-tests-obliterate-variable 'allout-tests-globally-true)
     (setq allout-tests-globally-true t)
     (allout-tests-obliterate-variable 'allout-tests-locally-true)
-    (set (make-local-variable 'allout-tests-locally-true) t)
+    (setq-local allout-tests-locally-true t)
     (allout-add-resumptions '(allout-tests-globally-unbound t)
                             '(allout-tests-globally-true nil)
                             '(allout-tests-locally-true nil))
     (allout-tests-obliterate-variable 'allout-tests-globally-true)
     (setq allout-tests-globally-true t)
     (allout-tests-obliterate-variable 'allout-tests-locally-true)
-    (set (make-local-variable 'allout-tests-locally-true) t)
+    (setq-local allout-tests-locally-true t)
     (allout-add-resumptions '(allout-tests-globally-unbound t)
                             '(allout-tests-globally-true nil)
                             '(allout-tests-locally-true nil))
index c77f2dc49905b3f63eb5b6a6cb1ff0108a7d2f81..6e9d50fc38f8493c3b863d13f6c265be7b8aef16 100644 (file)
@@ -67,8 +67,8 @@ If `prog-mode' is defined, inherit from it."
 
 (faceup-test-define-prog-mode faceup-test-mode "faceup-test"
   "Dummy major mode for testing `faceup', a test system for font-lock."
-  (set (make-local-variable 'syntax-propertize-function)
-       #'faceup-test-syntax-propertize)
+  (setq-local syntax-propertize-function
+              #'faceup-test-syntax-propertize)
   (setq font-lock-defaults '(faceup-test-font-lock-keywords nil)))
 
 (provide 'faceup-test-mode)
index c9c92f529bee9293b11f0a395355df0dec04aeec..87d19e8b2940ca751a0ca91a141e61f52a6c2c01 100644 (file)
@@ -96,8 +96,7 @@
                  context
                   (ert-resource-file "seckey.asc")))
           (with-temp-buffer
-            (make-local-variable 'epg-tests-context)
-            (setq epg-tests-context context)
+             (setq-local epg-tests-context context)
             ,@body))
        (when (file-directory-p epg-tests-home-directory)
         (delete-directory epg-tests-home-directory t)))))
index 1312683c848b48806cc0441e306037612ff41f47..c5fc3eaa11a445eb1d816a48179ecf93b45502df 100644 (file)
@@ -324,7 +324,7 @@ comparing the subr with a much slower lisp implementation."
 
 (defvar binding-test-some-local 'some)
 (with-current-buffer binding-test-buffer-A
-  (set (make-local-variable 'binding-test-some-local) 'local))
+  (setq-local binding-test-some-local 'local))
 
 (ert-deftest binding-test-manual ()
   "A test case from the elisp manual."