branch: externals/which-key
commit 8d6d81da4c7be4c929e908b1737dfd6d4c2aaa63
Author: Justin Burkett <jus...@burkett.cc>
Commit: Justin Burkett <jus...@burkett.cc>

    Expand get-keymap-bindings test
---
 Cask               |  1 +
 which-key-tests.el | 21 +++++++++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/Cask b/Cask
index 60fa07c..6ff7bbe 100644
--- a/Cask
+++ b/Cask
@@ -4,4 +4,5 @@
 (package-file "which-key.el")
 
 (development
+ (depends-on "evil")
  (depends-on "ert"))
diff --git a/which-key-tests.el b/which-key-tests.el
index 17d5d0d..eeedb55 100644
--- a/which-key-tests.el
+++ b/which-key-tests.el
@@ -141,24 +141,41 @@
 
 (ert-deftest which-key-test--get-keymap-bindings ()
   (let ((map (make-sparse-keymap))
+        (evil-local-mode t)
+        (evil-state 'normal)
         which-key-replacement-alist)
+    (require 'evil)
     (define-key map [which-key-a] '(which-key "blah"))
     (define-key map "b" 'ignore)
     (define-key map "c" "c")
     (define-key map "dd" "dd")
     (define-key map "eee" "eee")
     (define-key map "f" [123 45 6])
+    (define-key map (kbd "M-g g") "M-gg")
+    (evil-define-key* 'normal map (kbd "C-h") "C-h-normal")
+    (evil-define-key* 'insert map (kbd "C-h") "C-h-insert")
     (should (equal
              (sort (which-key--get-keymap-bindings map)
                    (lambda (a b) (string-lessp (car a) (car b))))
-             '(("c" . "c")
+             '(("M-g" . "prefix")
+               ("c" . "c")
+               ("d" . "prefix")
+               ("e" . "prefix")
+               ("f" . "{ - C-f"))))
+    (should (equal
+             (sort (which-key--get-keymap-bindings map nil nil nil nil t)
+                   (lambda (a b) (string-lessp (car a) (car b))))
+             '(("C-h" . "C-h-normal")
+               ("M-g" . "prefix")
+               ("c" . "c")
                ("d" . "prefix")
                ("e" . "prefix")
                ("f" . "{ - C-f"))))
     (should (equal
              (sort (which-key--get-keymap-bindings map nil nil nil t)
                    (lambda (a b) (string-lessp (car a) (car b))))
-             '(("c" . "c")
+             '(("M-g g" . "M-gg")
+               ("c" . "c")
                ("d d" . "dd")
                ("e e e" . "eee")
                ("f" . "{ - C-f"))))))

Reply via email to