emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] scratch/with-suppressed-warnings d816ec2: Finish tests


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] scratch/with-suppressed-warnings d816ec2: Finish tests
Date: Sun, 9 Jun 2019 16:05:17 -0400 (EDT)

branch: scratch/with-suppressed-warnings
commit d816ec234fb8f96c8e8fea24ae2f1eaa22ddf2e7
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Finish tests
---
 test/lisp/emacs-lisp/bytecomp-tests.el | 85 +++++++++++++++++++++++-----------
 1 file changed, 57 insertions(+), 28 deletions(-)

diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el 
b/test/lisp/emacs-lisp/bytecomp-tests.el
index d40a4a0..8470e07 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -709,37 +709,66 @@ literals (Bug#20852)."
     ))
 
 (ert-deftest bytecomp-test--with-suppressed-warnings ()
-  (test-suppression '(defvar prefixless)
-                    '((lexical prefixless))
-                    "global/dynamic var .prefixless. lacks")
-  (test-suppression '(defun foo()
-                       (let ((nil t))
-                         (message-mail)))
-                    '((constants nil))
-                    "Warning: attempt to let-bind constant .nil.")
-  (test-suppression '(progn
-                       (defun obsolete ()
-                         (declare (obsolete foo "22.1")))
-                       (defun zot ()
-                         (obsolete)))
-                    '((obsolete obsolete))
-                    "Warning: .obsolete. is an obsolete function")
-  (test-suppression '(progn
-                       (defun wrong-params (foo &optional unused)
-                         (ignore unused)
-                         foo)
-                       (defun zot ()
-                         (wrong-params 1 2 3)))
-                    '((callargs wrong-params))
-                    "Warning: wrong-params called with")
+  (test-suppression
+   '(defvar prefixless)
+   '((lexical prefixless))
+   "global/dynamic var .prefixless. lacks")
+
+  (test-suppression
+   '(defun foo()
+      (let ((nil t))
+        (message-mail)))
+   '((constants nil))
+   "Warning: attempt to let-bind constant .nil.")
+
+  (test-suppression
+   '(progn
+      (defun obsolete ()
+        (declare (obsolete foo "22.1")))
+      (defun zot ()
+        (obsolete)))
+   '((obsolete obsolete))
+   "Warning: .obsolete. is an obsolete function")
+
+  (test-suppression
+   '(progn
+      (defun wrong-params (foo &optional unused)
+        (ignore unused)
+        foo)
+      (defun zot ()
+        (wrong-params 1 2 3)))
+   '((callargs wrong-params))
+   "Warning: wrong-params called with")
+
   (test-byte-comp-compile-and-load nil
     (defvar obsolete-variable nil)
     (make-obsolete-variable 'obsolete-variable nil "24.1"))
-  (test-suppression '(defun zot ()
-                       obsolete-variable)
-                    '((obsolete obsolete-variable))
-                    "obsolete")
-  )
+  (test-suppression
+   '(defun zot ()
+      obsolete-variable)
+   '((obsolete obsolete-variable))
+   "obsolete")
+
+  (test-suppression
+   '(defun zot ()
+      (mapcar #'list '(1 2 3))
+      nil)
+   '((mapcar mapcar))
+   "Warning: .mapcar. called for effect")
+
+  (test-suppression
+   '(defun zot ()
+      free-variable)
+   '((free-vars free-variable))
+   "Warning: reference to free variable")
+
+  (test-suppression
+   '(defun zot ()
+      (save-excursion
+        (set-buffer (get-buffer-create "foo"))
+        nil))
+   '((suspicious set-buffer))
+   "Warning: Use .with-current-buffer. rather than"))
 
 ;; Local Variables:
 ;; no-byte-compile: t



reply via email to

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