[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Zero byte-compiler warnings in the test suite
From: |
Stefan Kangas |
Subject: |
Re: Zero byte-compiler warnings in the test suite |
Date: |
Wed, 22 Dec 2021 14:11:19 -0800 |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> How do we usually test compiler macros? I guess we should create a
>> separate file and try to byte-compile it?
>
> I'd do something like
>
> (should-error
> (macroexpand-all '(pcase ...)))
macroexpand-all didn't work, but I installed this, which seems to have
fixed it:
diff --git a/test/lisp/emacs-lisp/pcase-tests.el
b/test/lisp/emacs-lisp/pcase-tests.el
index 7ad01e7aef..40ae9809b5 100644
--- a/test/lisp/emacs-lisp/pcase-tests.el
+++ b/test/lisp/emacs-lisp/pcase-tests.el
@@ -107,8 +107,11 @@ pcase-tests-cl-type
(should (equal (pcase 1
((cl-type (integer 0 2)) 'integer-0<=n<=2))
'integer-0<=n<=2))
- (should-error (pcase 1
- ((cl-type notatype) 'integer))))
+ (should-error
+ ;; Avoid error at compile time due to compiler macro.
+ (eval '(pcase 1
+ ((cl-type notatype) 'integer))
+ t)))
(ert-deftest pcase-tests-setq ()
(should (equal (let (a b)
- Zero byte-compiler warnings in the test suite, Stefan Kangas, 2021/12/21
- Re: Zero byte-compiler warnings in the test suite, Lars Ingebrigtsen, 2021/12/21
- Re: Zero byte-compiler warnings in the test suite, Stefan Kangas, 2021/12/21
- Re: Zero byte-compiler warnings in the test suite, Stefan Monnier, 2021/12/21
- Re: Zero byte-compiler warnings in the test suite, Stefan Kangas, 2021/12/22
- Re: Zero byte-compiler warnings in the test suite, Stefan Monnier, 2021/12/22
- Re: Zero byte-compiler warnings in the test suite,
Stefan Kangas <=
- Weird non-caught error in ERT (was: Zero byte-compiler warnings in the test suite), Stefan Monnier, 2021/12/22
- Re: Weird non-caught error in ERT (was: Zero byte-compiler warnings in the test suite), Philipp Stephani, 2021/12/23
Re: Zero byte-compiler warnings in the test suite, Eli Zaretskii, 2021/12/21