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

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

[elpa] master efb76d3 06/31: Add a couple of tests for 'unique' behavior


From: Dmitry Gutov
Subject: [elpa] master efb76d3 06/31: Add a couple of tests for 'unique' behavior
Date: Sun, 14 Apr 2019 22:06:15 -0400 (EDT)

branch: master
commit efb76d31680d121db1bbf84afe3106dcd79a4bef
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Add a couple of tests for 'unique' behavior
---
 test/core-tests.el | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/test/core-tests.el b/test/core-tests.el
index f3655a8..d7f0103 100644
--- a/test/core-tests.el
+++ b/test/core-tests.el
@@ -48,6 +48,32 @@
       (company-abort)
       (should (null company--manual-prefix)))))
 
+(ert-deftest company-auto-begin-unique-cancels ()
+  (with-temp-buffer
+    (insert "abc")
+    (company-mode)
+    (let (company-frontends
+          (company-backends
+           (list (lambda (command &optional _)
+                   (cl-case command
+                     (prefix (buffer-substring (point-min) (point)))
+                     (candidates '("abc")))))))
+      (company-auto-begin)
+      (should (equal nil company-candidates)))))
+
+(ert-deftest company-manual-begin-unique-shows-completion ()
+  (with-temp-buffer
+    (insert "abc")
+    (company-mode)
+    (let (company-frontends
+          (company-backends
+           (list (lambda (command &optional _)
+                   (cl-case command
+                     (prefix (buffer-substring (point-min) (point)))
+                     (candidates '("abc")))))))
+      (company-manual-begin)
+      (should (equal '("abc") company-candidates)))))
+
 (ert-deftest company-abort-manual-when-too-short ()
   (let ((company-minimum-prefix-length 5)
         (company-abort-manual-when-too-short t)



reply via email to

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