Add test for substitute-command-keys with command remap
* test/lisp/help-tests.el (help-tests-remap-map): New variable. (help-tests-substitute-command-keys/remap): New test. (help-tests-substitute-command-keys/keymaps) (help-tests-substitute-command-keys/undefined-map): Fix indentation.
This commit is contained in:
parent
916eb895d1
commit
8ece715af6
1 changed files with 13 additions and 2 deletions
|
@ -91,7 +91,7 @@
|
|||
(ert-deftest help-tests-substitute-command-keys/keymaps ()
|
||||
(with-substitute-command-keys-test
|
||||
(test "\\{minibuffer-local-must-match-map}"
|
||||
"\
|
||||
"\
|
||||
key binding
|
||||
--- -------
|
||||
|
||||
|
@ -125,10 +125,21 @@ M-s next-matching-history-element
|
|||
(test "\\<minibuffer-local-must-match-map>\\[abort-recursive-edit]" "C-g")
|
||||
(test "\\<emacs-lisp-mode-map>\\[eval-defun]" "C-M-x")))
|
||||
|
||||
(defvar help-tests-remap-map
|
||||
(let ((map (make-keymap)))
|
||||
(define-key map (kbd "x") 'foo)
|
||||
(define-key map (kbd "y") 'bar)
|
||||
(define-key map [remap foo] 'bar)
|
||||
map))
|
||||
|
||||
(ert-deftest help-tests-substitute-command-keys/remap ()
|
||||
(should (equal (substitute-command-keys "\\<help-tests-remap-map>\\[foo]") "y"))
|
||||
(should (equal (substitute-command-keys "\\<help-tests-remap-map>\\[bar]") "y")))
|
||||
|
||||
(ert-deftest help-tests-substitute-command-keys/undefined-map ()
|
||||
(with-substitute-command-keys-test
|
||||
(test-re "\\{foobar-map}"
|
||||
"\nUses keymap [`'‘]foobar-map['’], which is not currently defined.\n")))
|
||||
"\nUses keymap [`'‘]foobar-map['’], which is not currently defined.\n")))
|
||||
|
||||
(ert-deftest help-tests-substitute-command-keys/quotes ()
|
||||
(with-substitute-command-keys-test
|
||||
|
|
Loading…
Add table
Reference in a new issue