emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ivy 93cabe2 2/2: Merge branch 'master' into externals/i


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy 93cabe2 2/2: Merge branch 'master' into externals/ivy
Date: Fri, 3 Sep 2021 13:46:45 -0400 (EDT)

branch: externals/ivy
commit 93cabe27411807908e554abb772236fb2f67d36a
Merge: 972980b 23bdb5a
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>

    Merge branch 'master' into externals/ivy
---
 ivy-test.el | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/ivy-test.el b/ivy-test.el
index dcef2fa..062a08b 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -1136,26 +1136,26 @@ Since `execute-kbd-macro' doesn't pick up a let-bound 
`default-directory'.")
            :dir "/tmp/"))))
 
 (ert-deftest ivy-partial-files ()
-  ;; FIXME: Can't catch `quit' condition.
-  ;; See issue #2906 and https://bugs.gnu.org/48603.
-  (skip-unless (< emacs-major-version 28))
-  (when (file-exists-p "/tmp/ivy-partial-test")
-    (delete-directory "/tmp/ivy-partial-test" t))
-  (mkdir "/tmp/ivy-partial-test/test1" t)
-  (mkdir "/tmp/ivy-partial-test/test2")
-  (define-key ivy-minibuffer-map (kbd "TAB") 'ivy-partial)
-  (should
-   (equal
-    (save-window-excursion
-      (condition-case nil
-          (ivy-with
-           '(let ((default-directory "/tmp/ivy-partial-test/"))
-             (counsel-find-file))
-           "t TAB TAB TAB C-g")
-        (quit ivy--old-cands)))
-    '("test1/" "test2/")))
-  (define-key ivy-minibuffer-map (kbd "TAB") 'ivy-partial-or-done)
-  (delete-directory "/tmp/ivy-partial-test" t))
+  (let (dir)
+    (unwind-protect
+        (let ((ivy-minibuffer-map
+               ;; Avoid modifying global `ivy-minibuffer-map'.
+               (easy-mmode-define-keymap
+                '(("\t" . ivy-partial)
+                  ;; Allow quitting during `execute-kbd-macro'.
+                  ;; See issue #2906 and URL `https://bugs.gnu.org/48603'.
+                  ("\C-g" . abort-recursive-edit))
+                nil nil `(:inherit ,ivy-minibuffer-map)))
+              (subdirs '("test1/" "test2/")))
+          (setq dir (file-name-as-directory (make-temp-file "ivy-test-" t)))
+          (dolist (subdir subdirs)
+            (make-directory (expand-file-name subdir dir)))
+          (should (equal (condition-case nil
+                             (ivy-with `(counsel-find-file nil ,dir)
+                                       "t TAB TAB TAB C-g")
+                           (quit ivy--old-cands))
+                         subdirs)))
+      (when dir (delete-directory dir t)))))
 
 (defun ivy-with-temp-buffer (expr keys)
   (let ((temp-buffer (generate-new-buffer " *temp*")))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]