summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-06-09 22:05:05 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-06-09 22:05:05 +0200
commitd816ec234fb8f96c8e8fea24ae2f1eaa22ddf2e7 (patch)
tree55c8a0ccd74c2e878a374bf8b81b77c93444e399
parentcd2e61a844aa9bf896856eb10bd3730368f56820 (diff)
downloademacs-d816ec234fb8f96c8e8fea24ae2f1eaa22ddf2e7.tar.gz
Finish tests
-rw-r--r--test/lisp/emacs-lisp/bytecomp-tests.el85
1 files changed, 57 insertions, 28 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index d40a4a07f37..8470e07cf9d 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