Commit d816ec23 authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen

Finish tests

parent cd2e61a8
Pipeline #1960 failed with stage
in 4 seconds
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment