emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] scratch/with-suppressed-warnings 30a8cfa: Start implementi


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] scratch/with-suppressed-warnings 30a8cfa: Start implementing tests
Date: Sun, 9 Jun 2019 14:34:12 -0400 (EDT)

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

    Start implementing tests
---
 test/lisp/emacs-lisp/bytecomp-tests.el | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el 
b/test/lisp/emacs-lisp/bytecomp-tests.el
index f45c920..6672bc4 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -680,6 +680,30 @@ literals (Bug#20852)."
       (should-not (member '(byte-constant 333) lap))
       (should (member '(byte-constant 444) lap)))))
 
+(ert-deftest bytecomp-test--with-suppressed-warnings ()
+  (let ((lexical-binding t)
+        (byte-compile-log-buffer (generate-new-buffer " *Compile-Log*")))
+    (let ((form '(defvar prefixless)))
+      (with-current-buffer byte-compile-log-buffer
+        (let ((inhibit-read-only t))
+          (erase-buffer)))
+      (test-byte-comp-compile-and-load t
+        form)
+      (with-current-buffer byte-compile-log-buffer
+        (goto-char (point-min))
+        (should (re-search-forward "global/dynamic var .prefixless. lacks"
+                                   nil t)))
+      (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))
+           ,form))
+      (with-current-buffer byte-compile-log-buffer
+        (goto-char (point-min))
+        (should-not (re-search-forward "global/dynamic var .prefixless. lacks"
+                                       nil t))))))
+
 ;; Local Variables:
 ;; no-byte-compile: t
 ;; End:



reply via email to

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