emacs-devel
[Top][All Lists]
Advanced

[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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]