[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 205030b 1/3: Make substitute-command-keys test less brittle
From: |
Stefan Kangas |
Subject: |
master 205030b 1/3: Make substitute-command-keys test less brittle |
Date: |
Wed, 22 Dec 2021 16:59:44 -0500 (EST) |
branch: master
commit 205030ba5a1f55dab9c748bcb322b8726d6c17e7
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
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.
---
test/lisp/help-tests.el | 30 ++++++++++++++++++++++++++----
1 file changed, 26 insertions(+), 4 deletions(-)
diff --git a/test/lisp/help-tests.el b/test/lisp/help-tests.el
index 715d9e5..a1ae838 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
")))