mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-21 07:30:50 -08:00
Expand get-keymap-bindings test
This commit is contained in:
parent
4e592ed7b9
commit
8d6d81da4c
2 changed files with 20 additions and 2 deletions
1
Cask
1
Cask
|
|
@ -4,4 +4,5 @@
|
|||
(package-file "which-key.el")
|
||||
|
||||
(development
|
||||
(depends-on "evil")
|
||||
(depends-on "ert"))
|
||||
|
|
|
|||
|
|
@ -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"))))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue