]> git.eshelyaron.com Git - emacs.git/commitdiff
Add test for when 'completion-auto-help' is 'visible'
authorMorgan Smith <Morgan.J.Smith@outlook.com>
Tue, 6 Jun 2023 19:02:57 +0000 (15:02 -0400)
committerEli Zaretskii <eliz@gnu.org>
Sat, 10 Jun 2023 17:53:01 +0000 (20:53 +0300)
* test/lisp/minibuffer-tests.el (completion-auto-help-test): Add
test for when 'completion-auto-help' is 'visible'.  Also test
for successful completion message.  (Bug#63913)

test/lisp/minibuffer-tests.el

index 1de8e56cbd4afa6ce430809b57291716ae0a8af6..a67fc5557722cbba692c27df18f5cda465a5ae19 100644 (file)
             '("a" "ab" "ac")
           (execute-kbd-macro (kbd "a TAB TAB"))
           (should (equal (car messages) "Complete, but not unique"))
-          (should-not (get-buffer-window "*Completions*" 0))))
+          (should-not (get-buffer-window "*Completions*" 0))
+          (execute-kbd-macro (kbd "b TAB"))
+          (should (equal (car messages) "Sole completion"))))
       (let ((completion-auto-help t))
         (completing-read-with-minibuffer-setup
             '("a" "ab" "ac")
           (execute-kbd-macro (kbd "a TAB TAB"))
-          (should (get-buffer-window "*Completions*" 0)))))))
+          (should (get-buffer-window "*Completions*" 0))
+          (execute-kbd-macro (kbd "b TAB"))
+          (should (equal (car messages) "Sole completion"))))
+      (let ((completion-auto-help 'visible))
+        (completing-read-with-minibuffer-setup
+         '("a" "ab" "ac" "achoo")
+         (execute-kbd-macro (kbd "a TAB TAB"))
+         (should (get-buffer-window "*Completions*" 0))
+         (execute-kbd-macro (kbd "ch TAB"))
+         (should (equal (car messages) "Sole completion")))))))
 
 (ert-deftest completion-auto-select-test ()
   (let ((completion-auto-select t))