diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-08-19 16:48:59 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-08-19 16:48:59 -0700 |
commit | 07fcbb558d797272b9f43547da60beda485873a3 (patch) | |
tree | 77d5da14e9f9d9d8b1d877c70c01296fd3893796 /test/lisp/help-tests.el | |
parent | c9bdeff3e45a7ac84a74a81bb048046f82dddc91 (diff) | |
parent | fb81c8c3adf8633f2f617c82f6019aef630860c7 (diff) | |
download | emacs-07fcbb558d797272b9f43547da60beda485873a3.tar.gz |
Merge remote-tracking branch 'origin/master' into athena/unstable
Diffstat (limited to 'test/lisp/help-tests.el')
-rw-r--r-- | test/lisp/help-tests.el | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/test/lisp/help-tests.el b/test/lisp/help-tests.el index 8034764741c..871417da3d2 100644 --- a/test/lisp/help-tests.el +++ b/test/lisp/help-tests.el @@ -26,6 +26,7 @@ (require 'ert) (eval-when-compile (require 'cl-lib)) +(require 'text-property-search) ; for `text-property-search-forward' (ert-deftest help-split-fundoc-SECTION () "Test new optional arg SECTION." @@ -60,9 +61,8 @@ (defmacro with-substitute-command-keys-test (&rest body) `(cl-flet* ((test (lambda (orig result) - (should (equal-including-properties - (substitute-command-keys orig) - result)))) + (should (equal (substitute-command-keys orig) + result)))) (test-re (lambda (orig regexp) (should (string-match (concat "^" regexp "$") @@ -110,14 +110,19 @@ C-<tab> file-cache-minibuffer-complete <prior> switch-to-completions <up> previous-line-or-history-element +M-g Prefix Command M-v switch-to-completions +M-g ESC Prefix Command + 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/keymap-change () @@ -222,6 +227,24 @@ M-s next-matching-history-element (define-minor-mode help-tests-minor-mode "Minor mode for testing shadowing.") +(ert-deftest help-tests-substitute-command-keys/add-key-face () + (should (equal (substitute-command-keys "\\[next-line]") + (propertize "C-n" + 'face 'help-key-binding + 'font-lock-face 'help-key-binding)))) + +(ert-deftest help-tests-substitute-command-keys/add-key-face-listing () + (with-temp-buffer + (insert (substitute-command-keys "\\{help-tests-minor-mode-map}")) + (goto-char (point-min)) + (text-property-search-forward 'face 'help-key-binding) + (should (looking-at "C-e")) + ;; Don't fontify trailing whitespace. + (should-not (get-text-property (+ (point) 3) 'face)) + (text-property-search-forward 'face 'help-key-binding) + (should (looking-at "x")) + (should-not (get-text-property (+ (point) 1) 'face)))) + (ert-deftest help-tests-substitute-command-keys/test-mode () (with-substitute-command-keys-test (with-temp-buffer |