summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/rmc-tests.el
diff options
context:
space:
mode:
authorFelician Nemeth <felician.nemeth@gmail.com>2022-03-17 12:44:43 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2022-03-17 12:55:39 +0100
commit6bbd1cc5c9cd3db40dcb1ce82f478473b1f78131 (patch)
tree8929cf5cfaf21b33d8541cb235ab21e271526128 /test/lisp/emacs-lisp/rmc-tests.el
parent7fef2e04b219f25c64db0e83ec6f4ae707fb7f83 (diff)
downloademacs-6bbd1cc5c9cd3db40dcb1ce82f478473b1f78131.tar.gz
emacs-6bbd1cc5c9cd3db40dcb1ce82f478473b1f78131.tar.bz2
emacs-6bbd1cc5c9cd3db40dcb1ce82f478473b1f78131.zip
Format long help texts better in read-multiple-choice
* lisp/emacs-lisp/rmc.el (rmc--show-help): Format long help texts better (bug#54430).
Diffstat (limited to 'test/lisp/emacs-lisp/rmc-tests.el')
-rw-r--r--test/lisp/emacs-lisp/rmc-tests.el24
1 files changed, 23 insertions, 1 deletions
diff --git a/test/lisp/emacs-lisp/rmc-tests.el b/test/lisp/emacs-lisp/rmc-tests.el
index c1c46d6400e..ed30d82c3b8 100644
--- a/test/lisp/emacs-lisp/rmc-tests.el
+++ b/test/lisp/emacs-lisp/rmc-tests.el
@@ -66,5 +66,27 @@
(should (equal (list char str)
(read-multiple-choice "Do it? " '((?y "yes") (?n "no"))))))))
-(provide 'rmc-tests)
+(ert-deftest test-read-multiple-choice-help ()
+ (let ((chars '(?o ?a))
+ help)
+ (cl-letf* (((symbol-function #'read-event)
+ (lambda ()
+ (message "chars %S" chars)
+ (when (= 1 (length chars))
+ (with-current-buffer "*Multiple Choice Help*"
+ (setq help (buffer-string))))
+ (pop chars))))
+ (read-multiple-choice
+ "Choose:"
+ '((?a "aaa")
+ (?b "bbb")
+ (?c "ccc" "a really long description of ccc")))
+ (should (equal help "Choose:
+
+a: [A]aa b: [B]bb c: [C]cc
+ a really long
+ description of ccc
+ \n?: [?]
+")))))
+
;;; rmc-tests.el ends here