summaryrefslogtreecommitdiff
path: root/test/lisp/subr-tests.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2021-01-08 21:40:45 +0100
committerAndrea Corallo <akrl@sdf.org>2021-01-08 21:40:45 +0100
commit400f620f24b90540f71673a998c41327237330be (patch)
tree2e94333ffc6ac99987f74833bafe3191eb83c4ed /test/lisp/subr-tests.el
parent213b5d73159cafbdd52b9c0fb0479544cca98a77 (diff)
parenta31bfd594523dc06941ceb89cdbeabcd4a5d19f7 (diff)
downloademacs-400f620f24b90540f71673a998c41327237330be.tar.gz
emacs-400f620f24b90540f71673a998c41327237330be.tar.bz2
emacs-400f620f24b90540f71673a998c41327237330be.zip
Merge remote-tracking branch 'savannah/master' into HEAD
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))