summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
diff options
context:
space:
mode:
authorJohn Williams <jrw@pobox.com>2017-10-12 16:02:39 -0700
committerNoam Postavsky <npostavs@gmail.com>2017-10-21 19:20:46 -0400
commit237e96bc5259e59ac5623a93a47f64abffab4e0b (patch)
treec52fd8086d4b4b2320fb0cd63b71b59cb1cc0498 /test/lisp/emacs-lisp
parentd719ea6ad5419bba2b376384c370dc2744dc718f (diff)
downloademacs-237e96bc5259e59ac5623a93a47f64abffab4e0b.tar.gz
Test that advice doesn't trigger bytecomp warnings (Bug#28803)
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-no-warnings-with-advice): New test. Copyright-paperwork-exempt: yes
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r--test/lisp/emacs-lisp/bytecomp-tests.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index 30d2a4753cf..f508c365427 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -564,6 +564,17 @@ and will be removed soon. See (elisp)Backquote in the manual.")))))))
(byte-compile-file source t)
(should (equal bytecomp-tests--foobar (cons 1 2)))))
+(ert-deftest bytecomp-tests--test-no-warnings-with-advice ()
+ (defun f ())
+ (define-advice f (:around (oldfun &rest args) test)
+ (apply oldfun args))
+ (with-current-buffer (get-buffer-create "*Compile-Log*")
+ (let ((inhibit-read-only t)) (erase-buffer)))
+ (test-byte-comp-compile-and-load t '(defun f ()))
+ (with-current-buffer (get-buffer-create "*Compile-Log*")
+ (goto-char (point-min))
+ (should-not (search-forward "Warning" nil t))))
+
;; Local Variables:
;; no-byte-compile: t
;; End: