]> git.eshelyaron.com Git - emacs.git/commitdiff
bytecomp-tests.el: Add new helper function
authorDamien Cassou <damien@cassou.me>
Mon, 11 Sep 2023 19:59:45 +0000 (21:59 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Wed, 13 Sep 2023 14:34:44 +0000 (16:34 +0200)
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp--without-warning-test): Add helper function.
(bytecomp-warn--ignore): Use the helper.

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

index cd1bda3ec55248c806513306fa17b21021d4cf90..c0adab75269596b2fb16adb1329f69dcf0b3210b 100644 (file)
@@ -937,14 +937,17 @@ byte-compiled.  Run with dynamic binding."
            (should (re-search-forward
                     (string-replace " " "[ \n]+" re-warning)))))))
 
+(defun bytecomp--without-warning-test (form)
+  (bytecomp--with-warning-test "\\`\\'" form))
+
 (ert-deftest bytecomp-warn--ignore ()
   (bytecomp--with-warning-test "unused"
     '(lambda (y) 6))
-  (bytecomp--with-warning-test "\\`\\'" ;No warning!
+  (bytecomp--without-warning-test
     '(lambda (y) (ignore y) 6))
   (bytecomp--with-warning-test "assq"
     '(lambda (x y) (progn (assq x y) 5)))
-  (bytecomp--with-warning-test "\\`\\'" ;No warning!
+  (bytecomp--without-warning-test
     '(lambda (x y) (progn (ignore (assq x y)) 5))))
 
 (ert-deftest bytecomp-warn-wrong-args ()