Add a couple of minibuffer completion tests

Add tests for regressions that followed commit ff3f17ca3c.

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.
This commit is contained in:
Eshel Yaron 2024-05-29 11:49:15 +02:00
parent 39d2f40252
commit a9af70849d
No known key found for this signature in database
GPG key ID: EF3EE9CA35D78618

View file

@ -630,5 +630,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-<down> M-<down> M-<down>"))
(should (equal "data/minibuffer-test-cttq$$tion" (minibuffer-contents))))))
(provide 'minibuffer-tests)
;;; minibuffer-tests.el ends here