better tests

This commit is contained in:
Jimmy Yuen Ho Wong 2020-07-07 14:17:00 +01:00
parent de49954965
commit 2ca2212f73

View file

@ -1936,11 +1936,17 @@
(define-prefix-command 'my/map)
(bind-key "<f1>" 'my/map nil nil))))
(defvar test-map (make-keymap))
(ert-deftest bind-key/845 ()
(bind-key "C-c f" 'ignore 'test-map)
(describe-personal-keybindings))
(defvar test-map (make-keymap))
(bind-key "<f1>" 'ignore 'test-map)
(should (eq (lookup-key test-map (kbd "<f1>")) 'ignore))
(let ((binding (cl-find "<f1>" personal-keybindings :test 'string= :key 'caar)))
(message "test-map %s" test-map)
(message "binding %s" binding)
(should (eq (cdar binding) 'test-map))
(should (eq (nth 1 binding) 'ignore))
(should (eq (nth 2 binding) nil))))
;; Local Variables:
;; indent-tabs-mode: nil