emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] scratch/with-suppressed-warnings cd2e61a 3/3: Add more tes


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] scratch/with-suppressed-warnings cd2e61a 3/3: Add more tests
Date: Sun, 9 Jun 2019 15:05:47 -0400 (EDT)

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

    Add more tests
---
 test/lisp/emacs-lisp/bytecomp-tests.el | 39 +++++++++++++++++++++++++++++-----
 1 file changed, 34 insertions(+), 5 deletions(-)

diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el 
b/test/lisp/emacs-lisp/bytecomp-tests.el
index 5ced07c..d40a4a0 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -687,9 +687,10 @@ literals (Bug#20852)."
     (with-current-buffer byte-compile-log-buffer
       (let ((inhibit-read-only t))
         (erase-buffer)))
-    (test-byte-comp-compile-and-load t
-      form)
+    (test-byte-comp-compile-and-load t form)
     (with-current-buffer byte-compile-log-buffer
+      (unless match
+        (error "%s" (buffer-string)))
       (goto-char (point-min))
       (should (re-search-forward match nil t)))
     ;; And that it's gone now.
@@ -697,8 +698,8 @@ literals (Bug#20852)."
       (let ((inhibit-read-only t))
         (erase-buffer)))
     (test-byte-comp-compile-and-load t
-      `(with-suppressed-warnings ,suppress
-         ,form))
+     `(with-suppressed-warnings ,suppress
+        ,form))
     (with-current-buffer byte-compile-log-buffer
       (goto-char (point-min))
       (should-not (re-search-forward match nil t)))
@@ -710,7 +711,35 @@ literals (Bug#20852)."
 (ert-deftest bytecomp-test--with-suppressed-warnings ()
   (test-suppression '(defvar prefixless)
                     '((lexical prefixless))
-                    "global/dynamic var .prefixless. lacks"))
+                    "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")
+  )
 
 ;; Local Variables:
 ;; no-byte-compile: t



reply via email to

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