From 205030ba5a1f55dab9c748bcb322b8726d6c17e7 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 22 Dec 2021 22:15:57 +0100 Subject: [PATCH] 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 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-" #'file-cache-minibuffer-complete + "" #'previous-history-element + "" #'next-history-element + "" #'minibuffer-complete + "" #'next-line-or-history-element + "" #'next-history-element + "" #'switch-to-completions + "" #'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- file-cache-minibuffer-complete switch-to-completions 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 "))) -- 2.39.2