[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/with-suppressed-warnings 2bc3815 2/3: Finish up re
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] scratch/with-suppressed-warnings 2bc3815 2/3: Finish up refactoring |
Date: |
Sun, 9 Jun 2019 15:05:47 -0400 (EDT) |
branch: scratch/with-suppressed-warnings
commit 2bc381511f9039b50370f9658da861a013faef9d
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Finish up refactoring
---
test/lisp/emacs-lisp/bytecomp-tests.el | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el
b/test/lisp/emacs-lisp/bytecomp-tests.el
index 5953dd3..5ced07c 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -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: