summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2021-01-16 10:15:47 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2021-01-16 14:21:57 -0500
commit0ab56a4e935b3aa759229923804ba33c841f425c (patch)
tree5657e2c4db800dd0c9cc88550b9955bbe132c66f /test
parentdf34ed8cbfdcf4584aa0ebfe827fac3a8d932bb6 (diff)
downloademacs-0ab56a4e935b3aa759229923804ba33c841f425c.tar.gz
* lisp/emacs-lisp/pcase.el: Add support for `not` to `pred`
(pcase--split-pred, pcase--funcall): Adjust for `not`. (pcase--get-macroexpander): New function. (pcase--edebug-match-macro, pcase--make-docstring) (pcase--macroexpand): Use it. * lisp/emacs-lisp/radix-tree.el (radix-tree-leaf): Use it! * doc/lispref/control.texi (The @code{pcase} macro): Document it. * lisp/emacs-lisp/ert.el (ert--explain-equal-rec): Remove redundant test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/pcase-tests.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/pcase-tests.el b/test/lisp/emacs-lisp/pcase-tests.el
index 1b06c6e7543..e6f4c097504 100644
--- a/test/lisp/emacs-lisp/pcase-tests.el
+++ b/test/lisp/emacs-lisp/pcase-tests.el
@@ -32,6 +32,10 @@
(should (equal (pcase '(2 . 3) ;bug#18554
(`(,hd . ,(and (pred atom) tl)) (list hd tl))
((pred consp) nil))
+ '(2 3)))
+ (should (equal (pcase '(2 . 3)
+ (`(,hd . ,(and (pred (not consp)) tl)) (list hd tl))
+ ((pred consp) nil))
'(2 3))))
(pcase-defmacro pcase-tests-plus (pat n)