emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 43f9692: * test/lisp/emacs-lisp/bytecomp-tests.el


From: Glenn Morris
Subject: [Emacs-diffs] master 43f9692: * test/lisp/emacs-lisp/bytecomp-tests.el
Date: Mon, 26 Mar 2018 21:56:41 -0400 (EDT)

branch: master
commit 43f96927285002552dac90d8f8764719770d3994
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>

    * test/lisp/emacs-lisp/bytecomp-tests.el
    (bytecomp-test-featurep-warnings): New.
---
 test/lisp/emacs-lisp/bytecomp-tests.el | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el 
b/test/lisp/emacs-lisp/bytecomp-tests.el
index 7330c67..7c5aa9a 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -27,6 +27,7 @@
 
 (require 'ert)
 (require 'cl-lib)
+(require 'bytecomp)
 
 ;;; Code:
 (defconst byte-opt-testsuite-arith-data
@@ -571,6 +572,38 @@ literals (Bug#20852)."
     (goto-char (point-min))
     (should-not (search-forward "Warning" nil t))))
 
+(ert-deftest bytecomp-test-featurep-warnings ()
+  (let ((byte-compile-log-buffer (generate-new-buffer " *Compile-Log*")))
+    (unwind-protect
+        (progn
+          (with-temp-buffer
+            (insert "\
+\(defun foo ()
+  (an-undefined-function))
+
+\(defun foo1 ()
+  (if (featurep 'xemacs)
+      (some-undefined-function-if)))
+
+\(defun foo2 ()
+  (and (featurep 'xemacs)
+      (some-undefined-function-and)))
+
+\(defun foo3 ()
+  (if (not (featurep 'emacs))
+      (some-undefined-function-not)))
+
+\(defun foo4 ()
+  (or (featurep 'emacs)
+      (some-undefined-function-or)))
+")
+            (byte-compile-from-buffer (current-buffer)))
+          (with-current-buffer byte-compile-log-buffer
+            (should (search-forward "an-undefined-function" nil t))
+            (should-not (search-forward "some-undefined-function" nil t))))
+      (if (buffer-live-p byte-compile-log-buffer)
+          (kill-buffer byte-compile-log-buffer)))))
+
 ;; Local Variables:
 ;; no-byte-compile: t
 ;; End:



reply via email to

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