aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2018-03-09 15:04:59 -0500
committerGlenn Morris2018-03-09 15:04:59 -0500
commit94a59a6d8377db809b395175f7dbb81e8325dcf2 (patch)
treeba16a7bca9fe2fe5264deabeaea611e876e9522c
parent80e145fc96765cc0a0f48ae2425294c8c92bce56 (diff)
downloademacs-94a59a6d8377db809b395175f7dbb81e8325dcf2.tar.gz
emacs-94a59a6d8377db809b395175f7dbb81e8325dcf2.zip
Quieten compilation of some test/lisp files
* test/lisp/dired-tests.el (dired-test-bug27243-02) (dired-test-bug27243-03, dired-test-bug27899) (dired-test-with-temp-dirs): Remove unused local variables. * test/lisp/hi-lock-tests.el (hi-lock-bug26666) (hi-lock-test-set-pattern): Mark unused arguments. * test/lisp/ses-tests.el (ses-tests-renamed-cells-row-insertion): Remove unused global "ses-tests-trigger". * test/lisp/simple-tests.el (line-number-at-pos-when-passing-point): Remove unused local "pos". * test/lisp/emacs-lisp/benchmark-tests.el (benchmark-tests): Pacify compiler. * test/lisp/emacs-lisp/package-tests.el (package-test-signed): Replace obsolete function epg-configuration. * test/lisp/ls-lisp-tests.el: * test/lisp/eshell/em-ls-tests.el: Require dired. * test/lisp/progmodes/ruby-mode-tests.el (ruby-forward-sexp-skips-method-calls-with-keyword-names): * test/lisp/vc/diff-mode-tests.el (diff-mode-test-ignore-trailing-dashes): Replace interactive funcs.
-rw-r--r--test/lisp/dired-tests.el23
-rw-r--r--test/lisp/emacs-lisp/benchmark-tests.el14
-rw-r--r--test/lisp/emacs-lisp/package-tests.el4
-rw-r--r--test/lisp/eshell/em-ls-tests.el1
-rw-r--r--test/lisp/hi-lock-tests.el4
-rw-r--r--test/lisp/ls-lisp-tests.el1
-rw-r--r--test/lisp/progmodes/ruby-mode-tests.el6
-rw-r--r--test/lisp/ses-tests.el3
-rw-r--r--test/lisp/simple-tests.el13
-rw-r--r--test/lisp/vc/diff-mode-tests.el2
10 files changed, 36 insertions, 35 deletions
diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el
index bb0e1bc3880..49ae4bc0400 100644
--- a/test/lisp/dired-tests.el
+++ b/test/lisp/dired-tests.el
@@ -210,12 +210,12 @@
210 (concat (file-name-as-directory test-dir) 210 (concat (file-name-as-directory test-dir)
211 (file-name-as-directory "test-subdir")))) 211 (file-name-as-directory "test-subdir"))))
212 (push (dired-find-file) buffers) 212 (push (dired-find-file) buffers)
213 (let ((pt2 (point))) ; Point is on test-file. 213 ;; Point is on test-file.
214 (switch-to-buffer buf) 214 (switch-to-buffer buf)
215 ;; Sanity check: point should now be back on the subdirectory. 215 ;; Sanity check: point should now be back on the subdirectory.
216 (should (eq (point) pt1)) 216 (should (eq (point) pt1))
217 (push (dired test-dir) buffers) 217 (push (dired test-dir) buffers)
218 (should (eq (point) pt1)))) 218 (should (eq (point) pt1)))
219 (dolist (buf buffers) 219 (dolist (buf buffers)
220 (when (buffer-live-p buf) (kill-buffer buf))) 220 (when (buffer-live-p buf) (kill-buffer buf)))
221 (delete-directory test-dir t)))) 221 (delete-directory test-dir t))))
@@ -224,7 +224,7 @@
224 "Test for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27243#61 ." 224 "Test for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27243#61 ."
225 (let ((test-dir (make-temp-file "test-dir-" t)) 225 (let ((test-dir (make-temp-file "test-dir-" t))
226 (dired-auto-revert-buffer t) 226 (dired-auto-revert-buffer t)
227 test-subdir1 test-subdir2 allbufs) 227 allbufs)
228 (unwind-protect 228 (unwind-protect
229 (progn 229 (progn
230 (with-current-buffer (find-file-noselect test-dir) 230 (with-current-buffer (find-file-noselect test-dir)
@@ -294,9 +294,9 @@
294 294
295(ert-deftest dired-test-bug27899 () 295(ert-deftest dired-test-bug27899 ()
296 "Test for https://debbugs.gnu.org/27899 ." 296 "Test for https://debbugs.gnu.org/27899 ."
297 (let* ((dir (expand-file-name "src" source-directory)) 297 (dired (list (expand-file-name "src" source-directory)
298 (buf (dired (list dir "cygw32.c" "alloc.c" "w32xfns.c" "xdisp.c"))) 298 "cygw32.c" "alloc.c" "w32xfns.c" "xdisp.c"))
299 (orig dired-hide-details-mode)) 299 (let ((orig dired-hide-details-mode))
300 (dired-goto-file (expand-file-name "cygw32.c")) 300 (dired-goto-file (expand-file-name "cygw32.c"))
301 (forward-line 0) 301 (forward-line 0)
302 (unwind-protect 302 (unwind-protect
@@ -362,8 +362,7 @@
362(defmacro dired-test-with-temp-dirs (just-empty-dirs &rest body) 362(defmacro dired-test-with-temp-dirs (just-empty-dirs &rest body)
363 "Helper macro for Bug#27940 test." 363 "Helper macro for Bug#27940 test."
364 (declare (indent 1) (debug body)) 364 (declare (indent 1) (debug body))
365 (let ((dir (make-symbol "dir")) 365 (let ((dir (make-symbol "dir")))
366 (ignore-funcs (make-symbol "ignore-funcs")))
367 `(let* ((,dir (make-temp-file "bug27940" t)) 366 `(let* ((,dir (make-temp-file "bug27940" t))
368 (dired-deletion-confirmer (lambda (_) "yes")) ; Suppress prompts. 367 (dired-deletion-confirmer (lambda (_) "yes")) ; Suppress prompts.
369 (inhibit-message t) 368 (inhibit-message t)
diff --git a/test/lisp/emacs-lisp/benchmark-tests.el b/test/lisp/emacs-lisp/benchmark-tests.el
index 8de7818bdbf..cba53aefc9f 100644
--- a/test/lisp/emacs-lisp/benchmark-tests.el
+++ b/test/lisp/emacs-lisp/benchmark-tests.el
@@ -23,9 +23,9 @@
23(require 'ert) 23(require 'ert)
24 24
25(ert-deftest benchmark-tests () 25(ert-deftest benchmark-tests ()
26 (let (str t-long t-short) 26 (let (str t-long t-short m)
27 (should (consp (benchmark-run nil (1+ 0)))) 27 (should (consp (benchmark-run nil (setq m (1+ 0)))))
28 (should (consp (benchmark-run 1 (1+ 0)))) 28 (should (consp (benchmark-run 1 (setq m (1+ 0)))))
29 (should (stringp (benchmark nil (1+ 0)))) 29 (should (stringp (benchmark nil (1+ 0))))
30 (should (stringp (benchmark 1 (1+ 0)))) 30 (should (stringp (benchmark 1 (1+ 0))))
31 (should (consp (benchmark-run-compiled nil (1+ 0)))) 31 (should (consp (benchmark-run-compiled nil (1+ 0))))
@@ -33,10 +33,10 @@
33 ;; First test is heavier, must need longer time. 33 ;; First test is heavier, must need longer time.
34 (should (> (car (benchmark-run nil 34 (should (> (car (benchmark-run nil
35 (let ((n 100000)) (while (> n 1) (setq n (1- n)))))) 35 (let ((n 100000)) (while (> n 1) (setq n (1- n))))))
36 (car (benchmark-run nil (1+ 0))))) 36 (car (benchmark-run nil (setq m (1+ 0))))))
37 (should (> (car (benchmark-run nil 37 (should (> (car (benchmark-run nil
38 (let ((n 100000)) (while (> n 1) (setq n (1- n)))))) 38 (let ((n 100000)) (while (> n 1) (setq n (1- n))))))
39 (car (benchmark-run nil (1+ 0))))) 39 (car (benchmark-run nil (setq m (1+ 0))))))
40 (should (> (car (benchmark-run-compiled nil 40 (should (> (car (benchmark-run-compiled nil
41 (let ((n 100000)) (while (> n 1) (setq n (1- n)))))) 41 (let ((n 100000)) (while (> n 1) (setq n (1- n))))))
42 (car (benchmark-run-compiled nil (1+ 0))))) 42 (car (benchmark-run-compiled nil (1+ 0)))))
@@ -46,6 +46,8 @@
46 (setq str (benchmark nil '(1+ 0))) 46 (setq str (benchmark nil '(1+ 0)))
47 (string-match "Elapsed time: \\([0-9.]+\\)" str) 47 (string-match "Elapsed time: \\([0-9.]+\\)" str)
48 (setq t-short (string-to-number (match-string 1 str))) 48 (setq t-short (string-to-number (match-string 1 str)))
49 (should (> t-long t-short)))) 49 (should (> t-long t-short))
50 ;; Silence compiler.
51 m))
50 52
51;;; benchmark-tests.el ends here. 53;;; benchmark-tests.el ends here.
diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el
index 83f52284889..0059c546ac2 100644
--- a/test/lisp/emacs-lisp/package-tests.el
+++ b/test/lisp/emacs-lisp/package-tests.el
@@ -473,8 +473,8 @@ Must called from within a `tar-mode' buffer."
473 (let ((process-environment 473 (let ((process-environment
474 (cons (format "HOME=%s" homedir) 474 (cons (format "HOME=%s" homedir)
475 process-environment))) 475 process-environment)))
476 (epg-check-configuration (epg-configuration)) 476 (epg-check-configuration
477 (epg-find-configuration 'OpenPGP)) 477 (epg-find-configuration 'OpenPGP)))
478 (delete-directory homedir t))))) 478 (delete-directory homedir t)))))
479 (let* ((keyring (expand-file-name "key.pub" package-test-data-dir)) 479 (let* ((keyring (expand-file-name "key.pub" package-test-data-dir))
480 (package-test-data-dir 480 (package-test-data-dir
diff --git a/test/lisp/eshell/em-ls-tests.el b/test/lisp/eshell/em-ls-tests.el
index 1ce832f1dcc..c5c9eac3249 100644
--- a/test/lisp/eshell/em-ls-tests.el
+++ b/test/lisp/eshell/em-ls-tests.el
@@ -26,6 +26,7 @@
26 26
27(require 'ert) 27(require 'ert)
28(require 'em-ls) 28(require 'em-ls)
29(require 'dired)
29 30
30(ert-deftest em-ls-test-bug27631 () 31(ert-deftest em-ls-test-bug27631 ()
31 "Test for https://debbugs.gnu.org/27631 ." 32 "Test for https://debbugs.gnu.org/27631 ."
diff --git a/test/lisp/hi-lock-tests.el b/test/lisp/hi-lock-tests.el
index 40d76ee9de5..4c639b03dca 100644
--- a/test/lisp/hi-lock-tests.el
+++ b/test/lisp/hi-lock-tests.el
@@ -29,7 +29,7 @@
29 (with-temp-buffer 29 (with-temp-buffer
30 (insert "a A b B\n") 30 (insert "a A b B\n")
31 (cl-letf (((symbol-function 'completing-read) 31 (cl-letf (((symbol-function 'completing-read)
32 (lambda (prompt coll x y z hist defaults) 32 (lambda (_prompt _coll _x _y _z _hist defaults)
33 (car defaults)))) 33 (car defaults))))
34 (dotimes (_ 2) 34 (dotimes (_ 2)
35 (let ((face (hi-lock-read-face-name))) 35 (let ((face (hi-lock-read-face-name)))
@@ -41,7 +41,7 @@
41 (with-temp-buffer 41 (with-temp-buffer
42 (insert "foo bar") 42 (insert "foo bar")
43 (cl-letf (((symbol-function 'completing-read) 43 (cl-letf (((symbol-function 'completing-read)
44 (lambda (prompt coll x y z hist defaults) 44 (lambda (_prompt _coll _x _y _z _hist defaults)
45 (car defaults)))) 45 (car defaults))))
46 (hi-lock-set-pattern "9999" (hi-lock-read-face-name)) ; No match 46 (hi-lock-set-pattern "9999" (hi-lock-read-face-name)) ; No match
47 (hi-lock-set-pattern "foo" (hi-lock-read-face-name))) 47 (hi-lock-set-pattern "foo" (hi-lock-read-face-name)))
diff --git a/test/lisp/ls-lisp-tests.el b/test/lisp/ls-lisp-tests.el
index d16ffa3acdb..91e8b0b7011 100644
--- a/test/lisp/ls-lisp-tests.el
+++ b/test/lisp/ls-lisp-tests.el
@@ -26,6 +26,7 @@
26;;; Code: 26;;; Code:
27(require 'ert) 27(require 'ert)
28(require 'ls-lisp) 28(require 'ls-lisp)
29(require 'dired)
29 30
30(ert-deftest ls-lisp-unload () 31(ert-deftest ls-lisp-unload ()
31 "Test for https://debbugs.gnu.org/xxxxx ." 32 "Test for https://debbugs.gnu.org/xxxxx ."
diff --git a/test/lisp/progmodes/ruby-mode-tests.el b/test/lisp/progmodes/ruby-mode-tests.el
index b16698fba11..72d83affaef 100644
--- a/test/lisp/progmodes/ruby-mode-tests.el
+++ b/test/lisp/progmodes/ruby-mode-tests.el
@@ -705,13 +705,15 @@ VALUES-PLIST is a list with alternating index and value elements."
705 705
706(ert-deftest ruby-forward-sexp-skips-method-calls-with-keyword-names () 706(ert-deftest ruby-forward-sexp-skips-method-calls-with-keyword-names ()
707 (ruby-with-temp-buffer ruby-sexp-test-example 707 (ruby-with-temp-buffer ruby-sexp-test-example
708 (goto-line 2) 708 (goto-char (point-min))
709 (forward-line 1)
709 (ruby-forward-sexp) 710 (ruby-forward-sexp)
710 (should (= 8 (line-number-at-pos))))) 711 (should (= 8 (line-number-at-pos)))))
711 712
712(ert-deftest ruby-backward-sexp-skips-method-calls-with-keyword-names () 713(ert-deftest ruby-backward-sexp-skips-method-calls-with-keyword-names ()
713 (ruby-with-temp-buffer ruby-sexp-test-example 714 (ruby-with-temp-buffer ruby-sexp-test-example
714 (goto-line 8) 715 (goto-char (point-min))
716 (forward-line 7)
715 (end-of-line) 717 (end-of-line)
716 (ruby-backward-sexp) 718 (ruby-backward-sexp)
717 (should (= 2 (line-number-at-pos))))) 719 (should (= 2 (line-number-at-pos)))))
diff --git a/test/lisp/ses-tests.el b/test/lisp/ses-tests.el
index c9966e237fa..d08237e285b 100644
--- a/test/lisp/ses-tests.el
+++ b/test/lisp/ses-tests.el
@@ -147,13 +147,10 @@ to A2 and inserting a row, makes A2 value empty, and A3 equal to
147 (should-not A2) 147 (should-not A2)
148 (should (eq A3 2))))) 148 (should (eq A3 2)))))
149 149
150; (defvar ses-tests-trigger nil)
151
152(ert-deftest ses-tests-renamed-cells-row-insertion () 150(ert-deftest ses-tests-renamed-cells-row-insertion ()
153 "Check that setting A1 to 1 and A2 to (1+ A1), and then renaming A1 to `foo' and A2 to `bar' jumping 151 "Check that setting A1 to 1 and A2 to (1+ A1), and then renaming A1 to `foo' and A2 to `bar' jumping
154to `bar' and inserting a row, makes A2 value empty, and `bar' equal to 152to `bar' and inserting a row, makes A2 value empty, and `bar' equal to
1552." 1532."
156 (setq ses-tests-trigger nil)
157 (let ((ses-initial-size '(2 . 1))) 154 (let ((ses-initial-size '(2 . 1)))
158 (with-temp-buffer 155 (with-temp-buffer
159 (ses-mode) 156 (ses-mode)
diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el
index 91fdd5e816e..64b341bd469 100644
--- a/test/lisp/simple-tests.el
+++ b/test/lisp/simple-tests.el
@@ -489,13 +489,12 @@ See Bug#21722."
489 (should (equal pos (point)))))) 489 (should (equal pos (point))))))
490 490
491(ert-deftest line-number-at-pos-when-passing-point () 491(ert-deftest line-number-at-pos-when-passing-point ()
492 (let (pos) 492 (with-temp-buffer
493 (with-temp-buffer 493 (insert "a\nb\nc\nd\n")
494 (insert "a\nb\nc\nd\n") 494 (should (equal (line-number-at-pos 1) 1))
495 (should (equal (line-number-at-pos 1) 1)) 495 (should (equal (line-number-at-pos 3) 2))
496 (should (equal (line-number-at-pos 3) 2)) 496 (should (equal (line-number-at-pos 5) 3))
497 (should (equal (line-number-at-pos 5) 3)) 497 (should (equal (line-number-at-pos 7) 4))))
498 (should (equal (line-number-at-pos 7) 4)))))
499 498
500 499
501;;; Auto fill. 500;;; Auto fill.
diff --git a/test/lisp/vc/diff-mode-tests.el b/test/lisp/vc/diff-mode-tests.el
index 1e35f9f7cd3..7900e41b257 100644
--- a/test/lisp/vc/diff-mode-tests.el
+++ b/test/lisp/vc/diff-mode-tests.el
@@ -182,7 +182,7 @@ youthfulness
182 (with-temp-buffer 182 (with-temp-buffer
183 (cd temp-dir) 183 (cd temp-dir)
184 (insert patch) 184 (insert patch)
185 (beginning-of-buffer) 185 (goto-char (point-min))
186 (diff-apply-hunk) 186 (diff-apply-hunk)
187 (diff-apply-hunk) 187 (diff-apply-hunk)
188 (diff-apply-hunk)) 188 (diff-apply-hunk))