diff options
author | Glenn Morris <rgm@gnu.org> | 2018-03-26 21:56:33 -0400 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2018-03-26 21:56:33 -0400 |
commit | 43f96927285002552dac90d8f8764719770d3994 (patch) | |
tree | ca2211a5c9562424dc8c3fd6eccda27be086643e /test/lisp/emacs-lisp | |
parent | c7d2a0dd76fbfaedb4caedac261bd0a8944281a8 (diff) | |
download | emacs-43f96927285002552dac90d8f8764719770d3994.tar.gz |
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test-featurep-warnings): New.
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r-- | test/lisp/emacs-lisp/bytecomp-tests.el | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index 7330c676140..7c5aa9abedd 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: |