]> git.eshelyaron.com Git - emacs.git/commitdiff
better tests
authorJimmy Yuen Ho Wong <wyuenho@gmail.com>
Tue, 7 Jul 2020 13:17:00 +0000 (14:17 +0100)
committerJimmy Yuen Ho Wong <wyuenho@gmail.com>
Wed, 8 Jul 2020 03:46:57 +0000 (04:46 +0100)
test/lisp/use-package/use-package-tests.el

index 5d346d94df385fed30307e092f3a6ad960292f71..f0784315f75d7ad4651a427e5d0db926d1f2d651 100644 (file)
       (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