From 3aaf9f43d7e93421d773380493204c71be12e22a Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Wed, 29 May 2024 11:49:15 +0200 Subject: [PATCH] Add a couple of minibuffer completion tests Add tests for regressions that followed commit ff3f17ca3cd. See discussion here: https://lists.gnu.org/archive/html/emacs-devel/2024-05/msg00701.html * test/lisp/minibuffer-tests.el (completion-cycle) (minibuffer-next-completion): New tests. --- test/lisp/minibuffer-tests.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el index 95f114934a7..b1fb8dfa983 100644 --- a/test/lisp/minibuffer-tests.el +++ b/test/lisp/minibuffer-tests.el @@ -663,5 +663,18 @@ (previous-line-completion 7) (should (equal "aa1" (get-text-property (point) 'completion--string)))))) +(ert-deftest completion-cycle () + (completing-read-with-minibuffer-setup '("aaa" "bbb" "ccc") + (let ((completion-cycle-threshold t)) + (execute-kbd-macro (kbd "TAB TAB TAB")) + (should (equal (minibuffer-contents) "ccc"))))) + +(ert-deftest minibuffer-next-completion () + (let ((default-directory (ert-resource-directory))) + (completing-read-with-minibuffer-setup #'read-file-name-internal + (insert "d/") + (execute-kbd-macro (kbd "M- M- M-")) + (should (equal "data/minibuffer-test-cttq$$tion" (minibuffer-contents)))))) + (provide 'minibuffer-tests) ;;; minibuffer-tests.el ends here -- 2.39.5