diff options
author | Stefan Kangas <stefan@marxist.se> | 2021-12-22 22:15:57 +0100 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2021-12-22 22:59:36 +0100 |
commit | 205030ba5a1f55dab9c748bcb322b8726d6c17e7 (patch) | |
tree | 1fe43aeac35ade927fe7857faa1d59d3f9a14313 /test/lisp/help-tests.el | |
parent | ec1312d76a6bb9b4011ab66adad1614a31747af8 (diff) | |
download | emacs-205030ba5a1f55dab9c748bcb322b8726d6c17e7.tar.gz emacs-205030ba5a1f55dab9c748bcb322b8726d6c17e7.tar.bz2 emacs-205030ba5a1f55dab9c748bcb322b8726d6c17e7.zip |
Make substitute-command-keys test less brittle
* test/lisp/help-tests.el (help-tests--test-keymap): New keymap
variable.
(help-tests-substitute-command-keys/keymaps): Make test less
brittle by using above new keymap.
Diffstat (limited to 'test/lisp/help-tests.el')
-rw-r--r-- | test/lisp/help-tests.el | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/test/lisp/help-tests.el b/test/lisp/help-tests.el index 715d9e5b8ac..a1ae838239c 100644 --- a/test/lisp/help-tests.el +++ b/test/lisp/help-tests.el @@ -106,11 +106,34 @@ (should (eq (get-text-property 0 'face (substitute-command-keys "\\`f'")) 'help-key-binding))) +(defvar-keymap help-tests--test-keymap + :doc "Just some keymap for testing." + "C-g" #'abort-minibuffers + "TAB" #'minibuffer-complete + "C-j" #'minibuffer-complete-and-exit + "RET" #'minibuffer-complete-and-exit + "SPC" #'minibuffer-complete-word + "?" #'minibuffer-completion-help + "C-<tab>" #'file-cache-minibuffer-complete + "<XF86Back>" #'previous-history-element + "<XF86Forward>" #'next-history-element + "<backtab>" #'minibuffer-complete + "<down>" #'next-line-or-history-element + "<next>" #'next-history-element + "<prior>" #'switch-to-completions + "<up>" #'previous-line-or-history-element + "M-v" #'switch-to-completions + "M-<" #'minibuffer-beginning-of-buffer + "M-n" #'next-history-element + "M-p" #'previous-history-element + "M-r" #'previous-matching-history-element + "M-s" #'next-matching-history-element + "M-g M-c" #'switch-to-completions) (ert-deftest help-tests-substitute-command-keys/keymaps () (with-substitute-command-keys-test - (test-re "\\{minibuffer-local-must-match-map}" - " + (test-re "\\{help-tests--test-keymap}" + " Key Binding -+ C-g abort-minibuffers @@ -128,13 +151,12 @@ C-<tab> file-cache-minibuffer-complete <prior> switch-to-completions <up> previous-line-or-history-element -M-v switch-to-completions - M-< minibuffer-beginning-of-buffer M-n next-history-element M-p previous-history-element M-r previous-matching-history-element M-s next-matching-history-element +M-v switch-to-completions M-g M-c switch-to-completions "))) |