]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix a couple of tests
authorEshel Yaron <me@eshelyaron.com>
Wed, 29 May 2024 06:46:48 +0000 (08:46 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 29 May 2024 06:46:48 +0000 (08:46 +0200)
test/lisp/emacs-lisp/rmc-tests.el
test/lisp/progmodes/project-tests.el

index de57011a4a25ff11b67e1306dc57503011e34684..406e4b410bb8e03d29de83430fa747e77c86319b 100644 (file)
                    `(?\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")))))
index 93943cef43b40d3a7f40a30de12376442aa86fb7..402bde4e03bd26e778ce1a561d5bd892ad300b1b 100644 (file)
@@ -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))))