From e287da5a8154d83a97107b64915ccc17e3a086b8 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sun, 2 Feb 2020 10:17:20 -0600 Subject: * lisp/emacs-lisp/map.el: Add keyword-only pattern abbreviation * lisp/emacs-lisp/map.el: Update version to 2.1. ((pcase-defmacro map)): Update docstring. (map--make-pcase-bindings): Match keyword pattern. * test/lisp/emacs-lisp/map-tests.el (test-map-plist-pcase): Add test. --- test/lisp/emacs-lisp/map-tests.el | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/lisp/emacs-lisp/map-tests.el') diff --git a/test/lisp/emacs-lisp/map-tests.el b/test/lisp/emacs-lisp/map-tests.el index 06fd55faad3..3ffef177711 100644 --- a/test/lisp/emacs-lisp/map-tests.el +++ b/test/lisp/emacs-lisp/map-tests.el @@ -376,5 +376,11 @@ Evaluate BODY for each created map. '((1 . 1) (2 . 5) (3 . 0))) '((3 . 0) (2 . 9) (1 . 6))))) +(ert-deftest test-map-plist-pcase () + (let ((plist '(:one 1 :two 2))) + (should (equal (pcase-let (((map :one (:two two)) plist)) + (list one two)) + '(1 2))))) + (provide 'map-tests) ;;; map-tests.el ends here -- cgit v1.2.1