Commit 2bc38151 authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen

Finish up refactoring

parent d3b78c85
......@@ -680,9 +680,10 @@ literals (Bug#20852)."
(should-not (member '(byte-constant 333) lap))
(should (member '(byte-constant 444) lap)))))
(defun test-suppression (form match)
(defun test-suppression (form suppress match)
(let ((lexical-binding t)
(byte-compile-log-buffer (generate-new-buffer " *Compile-Log*")))
;; Check that we get a warning without suppression.
(with-current-buffer byte-compile-log-buffer
(let ((inhibit-read-only t))
(erase-buffer)))
......@@ -691,18 +692,24 @@ literals (Bug#20852)."
(with-current-buffer byte-compile-log-buffer
(goto-char (point-min))
(should (re-search-forward match nil t)))
;; And that it's gone now.
(with-current-buffer byte-compile-log-buffer
(let ((inhibit-read-only t))
(erase-buffer)))
(test-byte-comp-compile-and-load t
`(with-suppressed-warnings ((lexical prefixless))
`(with-suppressed-warnings ,suppress
,form))
(with-current-buffer byte-compile-log-buffer
(goto-char (point-min))
(should-not (re-search-forward match nil t)))))
(should-not (re-search-forward match nil t)))
;; Also check that byte compiled forms are identical.
(should (equal (byte-compile form)
(byte-compile `(with-suppressed-warnings ,suppress ,form))))
))
(ert-deftest bytecomp-test--with-suppressed-warnings ()
(test-suppression '(defvar prefixless)
'((lexical prefixless))
"global/dynamic var .prefixless. lacks"))
;; Local Variables:
......
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