[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master dbdfd6f 64/78: Update the async tests
From: |
Dmitry Gutov |
Subject: |
[elpa] master dbdfd6f 64/78: Update the async tests |
Date: |
Sun, 18 Feb 2018 07:40:27 -0500 (EST) |
branch: master
commit dbdfd6f2ada5df6074f151ddf105328e60104f43
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Update the async tests
---
test/async-tests.el | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/test/async-tests.el b/test/async-tests.el
index 889ff13..3964b80 100644
--- a/test/async-tests.el
+++ b/test/async-tests.el
@@ -65,28 +65,26 @@
(company-mode)
(let (company-frontends
company-transformers
- (company-backends (list 'company-async-backend)))
- ;; FIXME: Remove such tests?
+ (company-backends (list 'company-async-backend))
+ unread-command-events
+ (start-time (current-time)))
(company-idle-begin (current-buffer) (selected-window)
(buffer-chars-modified-tick) (point))
- (should (null company-candidates))
- (sleep-for 0.1)
+ (should (< (time-to-seconds
+ (time-subtract (current-time) start-time))
+ 0.1))
(should (equal "foo" company-prefix))
(should (equal '("abc" "abd") company-candidates)))))
-(ert-deftest company-idle-begin-cancels-async-candidates-if-buffer-changed ()
+(ert-deftest company-idle-begin-with-async-aborts-on-user-input ()
(with-temp-buffer
(company-mode)
(let (company-frontends
- (company-backends (list 'company-async-backend)))
+ (company-backends (list 'company-async-backend))
+ (unread-command-events (list 'company-dummy-event)))
(company-idle-begin (current-buffer) (selected-window)
(buffer-chars-modified-tick) (point))
- (should (null company-candidates))
- (insert "a")
- (sleep-for 0.1)
- (should (null company-candidates))
- (should (null company-candidates-cache))
- (should (null company-backend)))))
+ (should (null company-candidates)))))
(ert-deftest company-idle-begin-async-allows-immediate-callbacks ()
(with-temp-buffer
@@ -101,7 +99,8 @@
(cons :async
(lambda (cb) (funcall cb c)))))
(`no-cache t)))))
- (company-minimum-prefix-length 0))
+ (company-minimum-prefix-length 0)
+ (unread-command-events (list 'company-dummy-event)))
(company-idle-begin (current-buffer) (selected-window)
(buffer-chars-modified-tick) (point))
(should (equal '("abc" "def") company-candidates))
- [elpa] master 0bd111d 49/78: Add keywords for kotlin-mode, (continued)
- [elpa] master 0bd111d 49/78: Add keywords for kotlin-mode, Dmitry Gutov, 2018/02/18
- [elpa] master f3910a2 71/78: Add a comment justifying the duplication [ci skip], Dmitry Gutov, 2018/02/18
- [elpa] master b079bd2 75/78: Revert "Break idle re-starting loop", Dmitry Gutov, 2018/02/18
- [elpa] master 7cc0901 77/78: Release 0.9.5, Dmitry Gutov, 2018/02/18
- [elpa] master d033112 28/78: Merge pull request #720 from aaronjensen/abort-dabbrev-on-input, Dmitry Gutov, 2018/02/18
- [elpa] master 3b5415a 41/78: company-tng: default config: Disable company-require-match, Dmitry Gutov, 2018/02/18
- [elpa] master 9b4488f 69/78: Rephrase, Dmitry Gutov, 2018/02/18
- [elpa] master e5e2c23 61/78: Make company-clang use cache again, Dmitry Gutov, 2018/02/18
- [elpa] master fe275d6 63/78: Tiny hack for better latency, Dmitry Gutov, 2018/02/18
- [elpa] master cf7141c 65/78: Fix noninteractive runs, Dmitry Gutov, 2018/02/18
- [elpa] master dbdfd6f 64/78: Update the async tests,
Dmitry Gutov <=
- [elpa] master 38ef92d 72/78: Force sync when company-require-match is t, Dmitry Gutov, 2018/02/18
- [elpa] master 259cf40 73/78: Break idle re-starting loop, Dmitry Gutov, 2018/02/18
- [elpa] master e65aa3f 78/78: Merge commit '7cc0901489dff3d73ddc845ae060f938ecb85615' from company, Dmitry Gutov, 2018/02/18