From 7fa3e754cb7af37b0c50f253e7dec2acd0275a8a Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 1 May 2020 13:02:38 +0200 Subject: Use lexical-binding in most remaining tests * test/lisp/comint-tests.el: * test/lisp/custom-resources/custom--test-theme.el: * test/lisp/dabbrev-tests.el: * test/lisp/emulation/viper-tests.el: * test/lisp/erc/erc-track-tests.el: * test/lisp/gnus/gnus-tests.el: * test/lisp/imenu-tests.el: * test/lisp/info-xref-tests.el: * test/lisp/jit-lock-tests.el: * test/lisp/json-tests.el: * test/lisp/man-tests.el: * test/lisp/replace-tests.el: * test/lisp/shadowfile-tests.el: * test/lisp/subr-tests.el: * test/lisp/thingatpt-tests.el: * test/lisp/xml-tests.el: Use lexical-binding. * test/lisp/man-tests.el (man-tests-filter-strings): * test/lisp/shadowfile-tests.el (shadow-test00-clusters) (shadow-test01-sites, shadow-test06-literal-groups) (shadow-test07-regexp-groups, shadow-test09-shadow-copy-files): Silence byte-compiler. --- test/lisp/comint-tests.el | 2 +- test/lisp/custom-resources/custom--test-theme.el | 2 ++ test/lisp/dabbrev-tests.el | 2 +- test/lisp/emulation/viper-tests.el | 2 +- test/lisp/erc/erc-track-tests.el | 2 +- test/lisp/gnus/gnus-tests.el | 2 +- test/lisp/imenu-tests.el | 2 +- test/lisp/info-xref-tests.el | 2 +- test/lisp/jit-lock-tests.el | 2 +- test/lisp/json-tests.el | 2 +- test/lisp/man-tests.el | 4 ++-- test/lisp/replace-tests.el | 2 +- test/lisp/shadowfile-tests.el | 20 ++++++++++---------- test/lisp/subr-tests.el | 2 +- test/lisp/thingatpt-tests.el | 2 +- test/lisp/xml-tests.el | 2 +- 16 files changed, 27 insertions(+), 25 deletions(-) diff --git a/test/lisp/comint-tests.el b/test/lisp/comint-tests.el index 9c27a92d2bf..132fe875f72 100644 --- a/test/lisp/comint-tests.el +++ b/test/lisp/comint-tests.el @@ -1,4 +1,4 @@ -;;; comint-testsuite.el +;;; comint-tests.el -*- lexical-binding:t -*- ;; Copyright (C) 2010-2020 Free Software Foundation, Inc. diff --git a/test/lisp/custom-resources/custom--test-theme.el b/test/lisp/custom-resources/custom--test-theme.el index da9121e0a0a..4ced98a50bc 100644 --- a/test/lisp/custom-resources/custom--test-theme.el +++ b/test/lisp/custom-resources/custom--test-theme.el @@ -1,3 +1,5 @@ +;;; custom--test-theme.el -- A test theme. -*- lexical-binding:t -*- + (deftheme custom--test "A test theme.") diff --git a/test/lisp/dabbrev-tests.el b/test/lisp/dabbrev-tests.el index 0a2f67e91c7..06c5c0655a7 100644 --- a/test/lisp/dabbrev-tests.el +++ b/test/lisp/dabbrev-tests.el @@ -1,4 +1,4 @@ -;;; dabbrev-tests.el --- Test suite for dabbrev. +;;; dabbrev-tests.el --- Test suite for dabbrev. -*- lexical-binding:t -*- ;; Copyright (C) 2016-2020 Free Software Foundation, Inc. diff --git a/test/lisp/emulation/viper-tests.el b/test/lisp/emulation/viper-tests.el index 33f85e51254..b981938fe19 100644 --- a/test/lisp/emulation/viper-tests.el +++ b/test/lisp/emulation/viper-tests.el @@ -1,4 +1,4 @@ -;;; viper-tests.el --- tests for viper. +;;; viper-tests.el --- tests for viper. -*- lexical-binding:t -*- ;; Copyright (C) 2016-2020 Free Software Foundation, Inc. diff --git a/test/lisp/erc/erc-track-tests.el b/test/lisp/erc/erc-track-tests.el index b0ed4bbcb67..7e924c22347 100644 --- a/test/lisp/erc/erc-track-tests.el +++ b/test/lisp/erc/erc-track-tests.el @@ -1,4 +1,4 @@ -;;; erc-track-tests.el --- Tests for erc-track. +;;; erc-track-tests.el --- Tests for erc-track. -*- lexical-binding:t -*- ;; Copyright (C) 2016-2020 Free Software Foundation, Inc. diff --git a/test/lisp/gnus/gnus-tests.el b/test/lisp/gnus/gnus-tests.el index d18b3fbed0f..fb1b204f042 100644 --- a/test/lisp/gnus/gnus-tests.el +++ b/test/lisp/gnus/gnus-tests.el @@ -1,4 +1,4 @@ -;;; gnus-tests.el --- Wrapper for the Gnus tests +;;; gnus-tests.el --- Wrapper for the Gnus tests -*- lexical-binding:t -*- ;; Copyright (C) 2011-2020 Free Software Foundation, Inc. diff --git a/test/lisp/imenu-tests.el b/test/lisp/imenu-tests.el index 684a856fe04..5dbeb882e01 100644 --- a/test/lisp/imenu-tests.el +++ b/test/lisp/imenu-tests.el @@ -1,4 +1,4 @@ -;;; imenu-tests.el --- Test suite for imenu. +;;; imenu-tests.el --- Test suite for imenu. -*- lexical-binding:t -*- ;; Copyright (C) 2013-2020 Free Software Foundation, Inc. diff --git a/test/lisp/info-xref-tests.el b/test/lisp/info-xref-tests.el index 128b3f25ca5..940aa7d8ad1 100644 --- a/test/lisp/info-xref-tests.el +++ b/test/lisp/info-xref-tests.el @@ -1,4 +1,4 @@ -;;; info-xref.el --- tests for info-xref.el +;;; info-xref.el --- tests for info-xref.el -*- lexical-binding:t -*- ;; Copyright (C) 2013-2020 Free Software Foundation, Inc. diff --git a/test/lisp/jit-lock-tests.el b/test/lisp/jit-lock-tests.el index 445716c14b9..dfa74cf35e7 100644 --- a/test/lisp/jit-lock-tests.el +++ b/test/lisp/jit-lock-tests.el @@ -1,4 +1,4 @@ -;;; jit-lock-tests.el --- tests for jit-lock +;;; jit-lock-tests.el --- tests for jit-lock -*- lexical-binding:t -*- ;; Copyright (C) 2016-2020 Free Software Foundation, Inc. diff --git a/test/lisp/json-tests.el b/test/lisp/json-tests.el index 05837e83f90..ac9706a8ae7 100644 --- a/test/lisp/json-tests.el +++ b/test/lisp/json-tests.el @@ -1,4 +1,4 @@ -;;; json-tests.el --- Test suite for json.el +;;; json-tests.el --- Test suite for json.el -*- lexical-binding:t -*- ;; Copyright (C) 2015-2020 Free Software Foundation, Inc. diff --git a/test/lisp/man-tests.el b/test/lisp/man-tests.el index fba4d748ce1..8267d8e4f6a 100644 --- a/test/lisp/man-tests.el +++ b/test/lisp/man-tests.el @@ -1,4 +1,4 @@ -;;; man-tests.el --- Test suite for man. +;;; man-tests.el --- Test suite for man. -*- lexical-binding:t -*- ;; Copyright (C) 2013-2020 Free Software Foundation, Inc. @@ -114,7 +114,7 @@ in the cdr of the element.") (dolist (test man-tests-parse-man-k-tests) (should (man-tests-parse-man-k-test-case test)))) -(defun man-tests-filter-strings (buffer strings) +(defun man-tests-filter-strings (_buffer strings) "Run `Man-bgproc-filter' on each of STRINGS. The formatted result will be inserted into BUFFER." (let ((proc (start-process "dummy man-tests proc" (current-buffer) "cat"))) diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el index af765fbe3fa..f5cff92d546 100644 --- a/test/lisp/replace-tests.el +++ b/test/lisp/replace-tests.el @@ -1,4 +1,4 @@ -;;; replace-tests.el --- tests for replace.el. +;;; replace-tests.el --- tests for replace.el. -*- lexical-binding:t -*- ;; Copyright (C) 2010-2020 Free Software Foundation, Inc. diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el index ed23e064743..03c62de1fd6 100644 --- a/test/lisp/shadowfile-tests.el +++ b/test/lisp/shadowfile-tests.el @@ -1,4 +1,4 @@ -;;; shadowfile-tests.el --- Tests of shadowfile +;;; shadowfile-tests.el --- Tests of shadowfile -*- lexical-binding:t -*- ;; Copyright (C) 2018-2020 Free Software Foundation, Inc. @@ -138,9 +138,9 @@ guaranteed by the originator of a cluster definition." ;; We must mock `read-from-minibuffer' and `read-string', in ;; order to avoid interactive arguments. (cl-letf* (((symbol-function #'read-from-minibuffer) - (lambda (&rest args) (pop mocked-input))) + (lambda (&rest _args) (pop mocked-input))) ((symbol-function #'read-string) - (lambda (&rest args) (pop mocked-input)))) + (lambda (&rest _args) (pop mocked-input)))) ;; Cleanup & initialize. (shadow--tests-cleanup) @@ -255,9 +255,9 @@ guaranteed by the originator of a cluster definition." ;; We must mock `read-from-minibuffer' and `read-string', in ;; order to avoid interactive arguments. (cl-letf* (((symbol-function #'read-from-minibuffer) - (lambda (&rest args) (pop mocked-input))) + (lambda (&rest _args) (pop mocked-input))) ((symbol-function #'read-string) - (lambda (&rest args) (pop mocked-input)))) + (lambda (&rest _args) (pop mocked-input)))) ;; Cleanup & initialize. (shadow--tests-cleanup) @@ -608,9 +608,9 @@ guaranteed by the originator of a cluster definition." ;; We must mock `read-from-minibuffer' and `read-string', in ;; order to avoid interactive arguments. (cl-letf* (((symbol-function #'read-from-minibuffer) - (lambda (&rest args) (pop mocked-input))) + (lambda (&rest _args) (pop mocked-input))) ((symbol-function #'read-string) - (lambda (&rest args) (pop mocked-input)))) + (lambda (&rest _args) (pop mocked-input)))) ;; Cleanup & initialize. (shadow--tests-cleanup) @@ -669,9 +669,9 @@ guaranteed by the originator of a cluster definition." ;; We must mock `read-from-minibuffer' and `read-string', in ;; order to avoid interactive arguments. (cl-letf* (((symbol-function #'read-from-minibuffer) - (lambda (&rest args) (pop mocked-input))) + (lambda (&rest _args) (pop mocked-input))) ((symbol-function #'read-string) - (lambda (&rest args) (pop mocked-input)))) + (lambda (&rest _args) (pop mocked-input)))) ;; Cleanup & initialize. (shadow--tests-cleanup) @@ -923,7 +923,7 @@ guaranteed by the originator of a cluster definition." ;; action. (add-function :before (symbol-function #'write-region) - (lambda (&rest args) + (lambda (&rest _args) (when (and (buffer-file-name) mocked-input) (should (equal (buffer-file-name) (pop mocked-input))))) '((name . "write-region-mock"))) diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index a583d57d2e8..e2761a96f86 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -1,4 +1,4 @@ -;;; subr-tests.el --- Tests for subr.el +;;; subr-tests.el --- Tests for subr.el -*- lexical-binding:t -*- ;; Copyright (C) 2015-2020 Free Software Foundation, Inc. diff --git a/test/lisp/thingatpt-tests.el b/test/lisp/thingatpt-tests.el index 4edf75edba6..f02aeaeef6a 100644 --- a/test/lisp/thingatpt-tests.el +++ b/test/lisp/thingatpt-tests.el @@ -1,4 +1,4 @@ -;;; thingatpt.el --- tests for thing-at-point. +;;; thingatpt.el --- tests for thing-at-point. -*- lexical-binding:t -*- ;; Copyright (C) 2013-2020 Free Software Foundation, Inc. diff --git a/test/lisp/xml-tests.el b/test/lisp/xml-tests.el index 895b68f79af..57e685cd347 100644 --- a/test/lisp/xml-tests.el +++ b/test/lisp/xml-tests.el @@ -1,4 +1,4 @@ -;;; xml-parse-tests.el --- Test suite for XML parsing. +;;; xml-parse-tests.el --- Test suite for XML parsing. -*- lexical-binding:t -*- ;; Copyright (C) 2012-2020 Free Software Foundation, Inc. -- cgit v1.2.1