diff options
| author | Stefan Kangas | 2021-12-26 00:45:50 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2021-12-26 17:03:36 +0100 |
| commit | 787030b0212d5933c3e4a16ece60b4e2ba8caea4 (patch) | |
| tree | 3aeb340132f529452612e55dc9d6077d58188003 /test | |
| parent | 68f15e815e0a475a13d8169cc5d163cf05e7e524 (diff) | |
| download | emacs-787030b0212d5933c3e4a16ece60b4e2ba8caea4.tar.gz 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')
| -rw-r--r-- | test/lisp/emacs-lisp/rmc-tests.el | 10 |
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 @@ | |||
| 22 | 22 | ||
| 23 | ;;; Commentary: | 23 | ;;; Commentary: |
| 24 | 24 | ||
| 25 | ;; | ||
| 26 | |||
| 27 | ;;; Code: | 25 | ;;; Code: |
| 28 | 26 | ||
| 29 | (require 'ert) | 27 | (require 'ert) |
| @@ -45,13 +43,16 @@ | |||
| 45 | `(?y . ,(concat (propertize "y" 'face 'read-multiple-choice-face) "es")))) | 43 | `(?y . ,(concat (propertize "y" 'face 'read-multiple-choice-face) "es")))) |
| 46 | (should (equal-including-properties | 44 | (should (equal-including-properties |
| 47 | (rmc--add-key-description '(?n "foo")) | 45 | (rmc--add-key-description '(?n "foo")) |
| 48 | '(?n . "[n] foo"))))) | 46 | `(?n . ,(concat "[" (propertize "n" 'face 'read-multiple-choice-face) "] foo")))))) |
| 49 | 47 | ||
| 50 | (ert-deftest test-rmc--add-key-description/non-graphical-display () | 48 | (ert-deftest test-rmc--add-key-description/non-graphical-display () |
| 51 | (cl-letf (((symbol-function 'display-supports-face-attributes-p) (lambda (_ _) nil))) | 49 | (cl-letf (((symbol-function 'display-supports-face-attributes-p) (lambda (_ _) nil))) |
| 52 | (should (equal-including-properties | 50 | (should (equal-including-properties |
| 53 | (rmc--add-key-description '(?y "yes")) | 51 | (rmc--add-key-description '(?y "yes")) |
| 54 | '(?y . "[Y]es"))))) | 52 | '(?y . "[Y]es"))) |
| 53 | (should (equal-including-properties | ||
| 54 | (rmc--add-key-description '(?n "foo")) | ||
| 55 | '(?n . "[n] foo"))))) | ||
| 55 | 56 | ||
| 56 | (ert-deftest test-read-multiple-choice () | 57 | (ert-deftest test-read-multiple-choice () |
| 57 | (dolist (char '(?y ?n)) | 58 | (dolist (char '(?y ?n)) |
| @@ -60,6 +61,5 @@ | |||
| 60 | (should (equal (list char str) | 61 | (should (equal (list char str) |
| 61 | (read-multiple-choice "Do it? " '((?y "yes") (?n "no")))))))) | 62 | (read-multiple-choice "Do it? " '((?y "yes") (?n "no")))))))) |
| 62 | 63 | ||
| 63 | |||
| 64 | (provide 'rmc-tests) | 64 | (provide 'rmc-tests) |
| 65 | ;;; rmc-tests.el ends here | 65 | ;;; rmc-tests.el ends here |