`(?\s . "SPC foo bar")))))
(ert-deftest test-rmc--add-key-description/with-attributes ()
- (cl-letf (((symbol-function 'display-supports-face-attributes-p) (lambda (_ _) t)))
- (should (equal-including-properties
- (rmc--add-key-description '(?y "yes"))
- `(?y . ,(concat (propertize "y" 'face 'read-multiple-choice) "es"))))
- (should (equal-including-properties
- (rmc--add-key-description '(?n "foo"))
- `(?n . ,(concat (propertize "n" 'face 'read-multiple-choice) " foo"))))
- (should (equal-including-properties
- (rmc--add-key-description '(?\s "foo bar"))
- `(?\s . ,(concat (propertize "SPC" 'face 'read-multiple-choice) " foo bar"))))))
-
-(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")))
- (should (equal-including-properties
- (rmc--add-key-description '(?n "foo"))
- `(?n . ,(concat (propertize "n" 'face 'help-key-binding) " foo"))))))
+ (should (equal-including-properties
+ (rmc--add-key-description '(?y "yes"))
+ `(?y . ,(concat (propertize "y" 'face 'read-multiple-choice) "es"))))
+ (should (equal-including-properties
+ (rmc--add-key-description '(?n "foo"))
+ `(?n . ,(concat (propertize "n" 'face 'read-multiple-choice) " foo"))))
+ (should (equal-including-properties
+ (rmc--add-key-description '(?\s "foo bar"))
+ `(?\s . ,(concat (propertize "SPC" 'face 'read-multiple-choice) " foo bar")))))
(ert-deftest test-read-multiple-choice ()
(dolist (char '(?y ?n))
(?c "ccc" "a really long description of ccc")))
(should (equal help "Choose:
-a: [A]aa b: [B]bb c: [C]cc
+a: aaa b: bbb c: ccc
a really long
description of ccc
\n")))))
(xref-search-program 'grep)
(xref-show-xrefs-function
(lambda (fetcher _display)
- (setq matches (funcall fetcher))))
- (current-prefix-arg t))
- (cl-letf (((symbol-function 'read-directory-name)
- (lambda (_prompt _default _dirname _mm) directory))
- ((symbol-function 'grep-read-files) (lambda (_re) "*")))
- (project-find-regexp "etc"))
+ (setq matches (funcall fetcher)))))
+ (project-find-regexp "etc" directory "*")
(should (equal (mapcar (lambda (item)
(file-name-base
(xref-location-group (xref-item-location item))))