summaryrefslogtreecommitdiff
path: root/test/lisp/subr-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/subr-tests.el')
-rw-r--r--test/lisp/subr-tests.el29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el
index bbb3b02a8fe..245a4a7c3af 100644
--- a/test/lisp/subr-tests.el
+++ b/test/lisp/subr-tests.el
@@ -61,6 +61,35 @@
(quote
(0 font-lock-keyword-face))))))))
+
+;;;; Keymap support.
+
+(ert-deftest subr-test-kbd ()
+ (should (equal (kbd "f") "f"))
+ (should (equal (kbd "<f1>") [f1]))
+ (should (equal (kbd "RET") "\C-m"))
+ (should (equal (kbd "C-x a") "\C-xa"))
+ ;; Check that kbd handles both new and old style key descriptions
+ ;; (bug#45536).
+ (should (equal (kbd "s-<return>") [s-return]))
+ (should (equal (kbd "<s-return>") [s-return]))
+ (should (equal (kbd "C-M-<return>") [C-M-return]))
+ (should (equal (kbd "<C-M-return>") [C-M-return])))
+
+(ert-deftest subr-test-define-prefix-command ()
+ (define-prefix-command 'foo-prefix-map)
+ (should (keymapp foo-prefix-map))
+ (should (fboundp #'foo-prefix-map))
+ ;; With optional argument.
+ (define-prefix-command 'bar-prefix 'bar-prefix-map)
+ (should (keymapp bar-prefix-map))
+ (should (fboundp #'bar-prefix))
+ ;; Returns the symbol.
+ (should (eq (define-prefix-command 'foo-bar) 'foo-bar)))
+
+
+;;;; Mode hooks.
+
(defalias 'subr-tests--parent-mode
(if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode))