From 96648baa9affefcce4e627d11a172a4a2a17c459 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Wed, 29 May 2024 08:46:48 +0200 Subject: [PATCH] Fix a couple of tests --- test/lisp/emacs-lisp/rmc-tests.el | 30 ++++++++++------------------ test/lisp/progmodes/project-tests.el | 8 ++------ 2 files changed, 12 insertions(+), 26 deletions(-) diff --git a/test/lisp/emacs-lisp/rmc-tests.el b/test/lisp/emacs-lisp/rmc-tests.el index de57011a4a2..406e4b410bb 100644 --- a/test/lisp/emacs-lisp/rmc-tests.el +++ b/test/lisp/emacs-lisp/rmc-tests.el @@ -39,25 +39,15 @@ `(?\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)) @@ -83,7 +73,7 @@ (?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"))))) diff --git a/test/lisp/progmodes/project-tests.el b/test/lisp/progmodes/project-tests.el index 93943cef43b..402bde4e03b 100644 --- a/test/lisp/progmodes/project-tests.el +++ b/test/lisp/progmodes/project-tests.el @@ -203,12 +203,8 @@ When `project-ignores' includes a name matching project dir." (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)))) -- 2.39.5