emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 375c70f: test/*.el: Avoid byte-compiler warnings


From: Juanma Barranquero
Subject: [Emacs-diffs] master 375c70f: test/*.el: Avoid byte-compiler warnings
Date: Sat, 28 Jan 2017 03:45:46 +0000 (UTC)

branch: master
commit 375c70fd9ef024f1a8ac99604e89c9991ac69eea
Author: Juanma Barranquero <address@hidden>
Commit: Juanma Barranquero <address@hidden>

    test/*.el: Avoid byte-compiler warnings
    
    * test/lisp/abbrev-tests.el (abbrev-table-p-test): Remove unused 'let*'.
    
    * test/lisp/faces-tests.el (faces--test): New customization group.
    (faces--test1, faces--test2): Use it.
    
    * test/lisp/ffap-tests.el (ffap-tests-25243):
    Call 'mark-whole-buffer' interactively.
    
    * test/lisp/ibuffer-tests.el (ibuffer-filter-groups, 
ibuffer-filtering-alist)
    (ibuffer-filtering-qualifiers, ibuffer-save-with-custom)
    (ibuffer-saved-filter-groups, ibuffer-saved-filters): Defvar.
    (ibuffer-format-qualifier, ibuffer-unary-operand): Declare.
    
    * test/lisp/minibuffer-tests.el (completion-test1):
    Mark unused lexical arguments.
    
    * test/lisp/simple-tests.el (simple-test--dummy-buffer): Wrap result in
    'with-no-warnings' to avoid them when the macro is invoked for effect.
    
    * test/lisp/emacs-lisp/cl-seq-tests.el (cl-seq-count-test):
    Mark unused lexical arguments.
    
    * test/lisp/emacs-lisp/let-alist-tests.el (let-alist-surface-test):
    Mark unused lexical arguments.
    (let-alist-cons): Remove unused let binding.
    
    * test/lisp/net/dbus-tests.el (dbus-debug): Defvar.
    (dbus-get-unique-name): Declare.
    
    * test/lisp/progmodes/python-tests.el (python-bob-infloop-avoid):
    Call 'font-lock-fontify-buffer' interactively.
    
    * test/lisp/textmodes/tildify-tests.el (tildify-space-undo-test--test):
    Mark unused lexical argument.
---
 test/lisp/abbrev-tests.el               |    3 +--
 test/lisp/emacs-lisp/cl-seq-tests.el    |    6 +++---
 test/lisp/emacs-lisp/let-alist-tests.el |    5 ++---
 test/lisp/faces-tests.el                |    9 +++++++--
 test/lisp/ffap-tests.el                 |    2 +-
 test/lisp/ibuffer-tests.el              |    9 +++++++++
 test/lisp/minibuffer-tests.el           |    2 +-
 test/lisp/net/dbus-tests.el             |    3 ++-
 test/lisp/progmodes/python-tests.el     |    2 +-
 test/lisp/simple-tests.el               |    6 +++---
 test/lisp/textmodes/tildify-tests.el    |    2 +-
 11 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/test/lisp/abbrev-tests.el b/test/lisp/abbrev-tests.el
index a454471..1ffcd6a 100644
--- a/test/lisp/abbrev-tests.el
+++ b/test/lisp/abbrev-tests.el
@@ -45,8 +45,7 @@
   (should-not (abbrev-table-p []))
   ;; Missing :abbrev-table-modiff counter:
   (should-not (abbrev-table-p (obarray-make)))
-  (let* ((table (obarray-make)))
-    (should (abbrev-table-empty-p (make-abbrev-table)))))
+  (should (abbrev-table-empty-p (make-abbrev-table))))
 
 (ert-deftest abbrev-make-abbrev-table-test ()
   ;; Table without properties:
diff --git a/test/lisp/emacs-lisp/cl-seq-tests.el 
b/test/lisp/emacs-lisp/cl-seq-tests.el
index 3740b5c..61e3d72 100644
--- a/test/lisp/emacs-lisp/cl-seq-tests.el
+++ b/test/lisp/emacs-lisp/cl-seq-tests.el
@@ -250,9 +250,9 @@ Body are forms defining the test."
     (should (= 0 (cl-count -5 list)))
     (should (= 0 (cl-count 2 list :start 2 :end 4)))
     (should (= 4 (cl-count 'foo list :key (lambda (x) (and (cl-evenp x) 
'foo)))))
-    (should (= 4 (cl-count 'foo list :test (lambda (a b) (cl-evenp b)))))
-    (should (equal (cl-count 'foo list :test (lambda (a b) (cl-oddp b)))
-                   (cl-count 'foo list :test-not (lambda (a b) (cl-evenp 
b)))))))
+    (should (= 4 (cl-count 'foo list :test (lambda (_a b) (cl-evenp b)))))
+    (should (equal (cl-count 'foo list :test (lambda (_a b) (cl-oddp b)))
+                   (cl-count 'foo list :test-not (lambda (_a b) (cl-evenp 
b)))))))
 
 ;; keywords supported:  :test :test-not :key :start1 :end1 :start2 :end2 
:from-end
 (ert-deftest cl-seq-mismatch-test ()
diff --git a/test/lisp/emacs-lisp/let-alist-tests.el 
b/test/lisp/emacs-lisp/let-alist-tests.el
index fbcde4e..d046457 100644
--- a/test/lisp/emacs-lisp/let-alist-tests.el
+++ b/test/lisp/emacs-lisp/let-alist-tests.el
@@ -31,7 +31,7 @@
                    (.test-two (cdr (assq 'test-two symbol))))
                (list .test-one .test-two
                      .test-two .test-two)))
-          (cl-letf (((symbol-function #'make-symbol) (lambda (x) 'symbol)))
+          (cl-letf (((symbol-function #'make-symbol) (lambda (_x) 'symbol)))
             (macroexpand
              '(let-alist data (list .test-one .test-two
                                     .test-two .test-two))))))
@@ -51,8 +51,7 @@
 (ert-deftest let-alist-cons ()
   (should
    (equal
-    (let ((.external "ext")
-          (.external.too "et"))
+    (let ((.external "ext"))
       (let-alist '((test-two . 0)
                    (test-three . 1)
                    (sublist . ((foo . 2)
diff --git a/test/lisp/faces-tests.el b/test/lisp/faces-tests.el
index a30ba25..2b3456d 100644
--- a/test/lisp/faces-tests.el
+++ b/test/lisp/faces-tests.el
@@ -23,13 +23,18 @@
 (require 'ert)
 (require 'faces)
 
+(defgroup faces--test nil ""
+  :group 'faces--test)
+
 (defface faces--test1
   '((t :background "black" :foreground "black"))
-  "")
+  ""
+  :group 'faces--test)
 
 (defface faces--test2
   '((t :box 1))
-  "")
+  ""
+  :group 'faces--test)
 
 (ert-deftest faces--test-color-at-point ()
   (with-temp-buffer
diff --git a/test/lisp/ffap-tests.el b/test/lisp/ffap-tests.el
index a3fe350..827d751 100644
--- a/test/lisp/ffap-tests.el
+++ b/test/lisp/ffap-tests.el
@@ -44,7 +44,7 @@ index 3d7cebadcf..ad4b70d737 100644
                 str
                 (make-string ffap-max-region-length #xa)
                 (format "%s ENDS HERE" file)))
-              (mark-whole-buffer)
+              (call-interactively 'mark-whole-buffer)
               (should (equal "" (ffap-string-at-point)))
               (should (equal '(1 1) ffap-string-at-point-region)))))
       (and (file-exists-p file) (delete-file file)))))
diff --git a/test/lisp/ibuffer-tests.el b/test/lisp/ibuffer-tests.el
index fb632e2..b9f7fe7 100644
--- a/test/lisp/ibuffer-tests.el
+++ b/test/lisp/ibuffer-tests.el
@@ -23,6 +23,15 @@
 (eval-when-compile
   (require 'ibuf-macs))
 
+(defvar ibuffer-filter-groups)
+(defvar ibuffer-filtering-alist)
+(defvar ibuffer-filtering-qualifiers)
+(defvar ibuffer-save-with-custom)
+(defvar ibuffer-saved-filter-groups)
+(defvar ibuffer-saved-filters)
+(declare-function ibuffer-format-qualifier "ibuf-ext" (qualifier))
+(declare-function ibuffer-unary-operand "ibuf-ext" (filter))
+
 (ert-deftest ibuffer-autoload ()
   "Tests to see whether ibuffer has been autoloaded"
   (skip-unless (not (featurep 'ibuf-ext)))
diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el
index efed8f8..7c5fcb4 100644
--- a/test/lisp/minibuffer-tests.el
+++ b/test/lisp/minibuffer-tests.el
@@ -28,7 +28,7 @@
 
 (ert-deftest completion-test1 ()
   (with-temp-buffer
-    (cl-flet* ((test/completion-table (string pred action)
+    (cl-flet* ((test/completion-table (_string _pred action)
                                       (if (eq action 'lambda)
                                           nil
                                         "test: "))
diff --git a/test/lisp/net/dbus-tests.el b/test/lisp/net/dbus-tests.el
index 525709b..0a59e3b 100644
--- a/test/lisp/net/dbus-tests.el
+++ b/test/lisp/net/dbus-tests.el
@@ -22,7 +22,8 @@
 (require 'ert)
 (require 'dbus)
 
-(setq dbus-debug nil)
+(defvar dbus-debug nil)
+(declare-function dbus-get-unique-name "dbusbind.c" (bus))
 
 (defvar dbus--test-enabled-session-bus
   (and (featurep 'dbusbind)
diff --git a/test/lisp/progmodes/python-tests.el 
b/test/lisp/progmodes/python-tests.el
index 158c52f..1e6b867 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -2478,7 +2478,7 @@ if x:
   (python-tests-with-temp-buffer
       " \"\n"
     (goto-char (point-min))
-    (font-lock-fontify-buffer)))
+    (call-interactively 'font-lock-fontify-buffer)))
 
 
 ;;; Shell integration
diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el
index 6194cad..f4849c4 100644
--- a/test/lisp/simple-tests.el
+++ b/test/lisp/simple-tests.el
@@ -30,8 +30,9 @@
      (insert "(a b")
      (save-excursion (insert " c d)"))
      ,@body
-     (cons (buffer-substring (point-min) (point))
-           (buffer-substring (point) (point-max)))))
+     (with-no-warnings
+       (cons (buffer-substring (point-min) (point))
+             (buffer-substring (point) (point-max))))))
 
 
 (defmacro simple-test--transpositions (&rest body)
@@ -266,7 +267,6 @@
    (with-temp-buffer
      (setq buffer-undo-list nil)
      (insert "hello")
-     (car buffer-undo-list)
      (undo-auto--boundaries 'test))))
 
 ;;; Transposition with negative args (bug#20698, bug#21885)
diff --git a/test/lisp/textmodes/tildify-tests.el 
b/test/lisp/textmodes/tildify-tests.el
index 0a82b25..f958fbc 100644
--- a/test/lisp/textmodes/tildify-tests.el
+++ b/test/lisp/textmodes/tildify-tests.el
@@ -226,7 +226,7 @@ The function must terminate as soon as callback returns 
nil."
 
 
 (defun tildify-space-undo-test--test
-    (modes nbsp env-open &optional set-space-string)
+    (modes nbsp _env-open &optional set-space-string)
   (with-temp-buffer
     (setq-local buffer-file-coding-system 'utf-8)
     (dolist (mode modes)



reply via email to

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