]> git.eshelyaron.com Git - emacs.git/commitdiff
Test that advice doesn't trigger bytecomp warnings (Bug#28803)
authorJohn Williams <jrw@pobox.com>
Thu, 12 Oct 2017 23:02:39 +0000 (16:02 -0700)
committerNoam Postavsky <npostavs@gmail.com>
Sat, 21 Oct 2017 23:20:46 +0000 (19:20 -0400)
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--test-no-warnings-with-advice): New test.

Copyright-paperwork-exempt: yes

test/lisp/emacs-lisp/bytecomp-tests.el

index 30d2a4753cf4f391ba8be3f084ec1ae6616b4f9b..f508c3654278d69fb81fbe0e1787a30335c1ab3c 100644 (file)
@@ -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: