summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2021-12-26 00:45:50 +0100
committerStefan Kangas <stefan@marxist.se>2021-12-26 17:03:36 +0100
commit787030b0212d5933c3e4a16ece60b4e2ba8caea4 (patch)
tree3aeb340132f529452612e55dc9d6077d58188003 /test/lisp/emacs-lisp
parent68f15e815e0a475a13d8169cc5d163cf05e7e524 (diff)
downloademacs-787030b0212d5933c3e4a16ece60b4e2ba8caea4.tar.gz
emacs-787030b0212d5933c3e4a16ece60b4e2ba8caea4.tar.bz2
emacs-787030b0212d5933c3e4a16ece60b4e2ba8caea4.zip
read-multiple-choice: Add face when key not in name string
* lisp/emacs-lisp/rmc.el (rmc--add-key-description): Add face property also when key is not in the name string. * test/lisp/emacs-lisp/rmc-tests.el (test-rmc--add-key-description/with-attributes) (test-rmc--add-key-description/non-graphical-display): Update tests.
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r--test/lisp/emacs-lisp/rmc-tests.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/lisp/emacs-lisp/rmc-tests.el b/test/lisp/emacs-lisp/rmc-tests.el
index e858ed39405..a97254c46dc 100644
--- a/test/lisp/emacs-lisp/rmc-tests.el
+++ b/test/lisp/emacs-lisp/rmc-tests.el
@@ -22,8 +22,6 @@
;;; Commentary:
-;;
-
;;; Code:
(require 'ert)
@@ -45,13 +43,16 @@
`(?y . ,(concat (propertize "y" 'face 'read-multiple-choice-face) "es"))))
(should (equal-including-properties
(rmc--add-key-description '(?n "foo"))
- '(?n . "[n] foo")))))
+ `(?n . ,(concat "[" (propertize "n" 'face 'read-multiple-choice-face) "] foo"))))))
(ert-deftest test-rmc--add-key-description/non-graphical-display ()
(cl-letf (((symbol-function 'display-supports-face-attributes-p) (lambda (_ _) nil)))
(should (equal-including-properties
(rmc--add-key-description '(?y "yes"))
- '(?y . "[Y]es")))))
+ '(?y . "[Y]es")))
+ (should (equal-including-properties
+ (rmc--add-key-description '(?n "foo"))
+ '(?n . "[n] foo")))))
(ert-deftest test-read-multiple-choice ()
(dolist (char '(?y ?n))
@@ -60,6 +61,5 @@
(should (equal (list char str)
(read-multiple-choice "Do it? " '((?y "yes") (?n "no"))))))))
-
(provide 'rmc-tests)
;;; rmc-tests.el ends here