[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master d436c559a4f 1/3: bytecomp-tests.el: Add new helper function
From: |
Stefan Kangas |
Subject: |
master d436c559a4f 1/3: bytecomp-tests.el: Add new helper function |
Date: |
Wed, 13 Sep 2023 10:38:12 -0400 (EDT) |
branch: master
commit d436c559a4fa7154802f4c898630266a3ff6efa9
Author: Damien Cassou <damien@cassou.me>
Commit: Stefan Kangas <stefankangas@gmail.com>
bytecomp-tests.el: Add new helper function
* 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 | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el
b/test/lisp/emacs-lisp/bytecomp-tests.el
index cd1bda3ec55..c0adab75269 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -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 ()