]> git.eshelyaron.com Git - emacs.git/commitdiff
Test that substitute-command-keys preserves text properties
authorStefan Kangas <stefan@marxist.se>
Tue, 17 Nov 2020 01:17:14 +0000 (02:17 +0100)
committerStefan Kangas <stefan@marxist.se>
Tue, 17 Nov 2020 01:21:17 +0000 (02:21 +0100)
* test/lisp/help-tests.el
(help-substitute-command-keys/preserves-text-properties): New test.
(Bug#17052)

test/lisp/help-tests.el

index 42be0296c4fa8f185943b0cab91245c46298fcb8..49cb40b29d97151d0d40d9aa8a6a661223fd8511 100644 (file)
@@ -392,6 +392,12 @@ C-b                undefined
     (define-key global-map (kbd "C-c C-l r") nil)
     (define-key global-map (kbd "C-c C-l") nil)))
 
+(ert-deftest help-substitute-command-keys/preserves-text-properties ()
+  "Check that we preserve text properties (Bug#17052)."
+  (should (equal (substitute-command-keys
+                  (propertize "foo \\[save-buffer]" 'face 'bold))
+                 (propertize "foo C-x C-s" 'face 'bold))))
+
 (provide 'help-tests)
 
 ;;; help-tests.el ends here