[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/company 7b849c0c6f 18/24: Mo tests and some fixes
From: |
ELPA Syncer |
Subject: |
[elpa] externals/company 7b849c0c6f 18/24: Mo tests and some fixes |
Date: |
Tue, 27 Aug 2024 00:57:44 -0400 (EDT) |
branch: externals/company
commit 7b849c0c6f61242197facd58371c95241ec8af48
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>
Mo tests and some fixes
---
company.el | 3 ++-
test/core-tests.el | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+), 1 deletion(-)
diff --git a/company.el b/company.el
index f7182dae85..364652f455 100644
--- a/company.el
+++ b/company.el
@@ -1472,7 +1472,7 @@ be recomputed when this value changes."
(aref (car (nth 2 tuple)) beg)))
(cl-incf beg))
(while (and (< end max-end)
- (= (aref prefix (- bslen end 1))
+ (= (aref suffix (- bslen end 1))
(aref (cdr (nth 2 tuple))
(- rep-suffix-len end 1))))
(cl-incf end))
@@ -1495,6 +1495,7 @@ be recomputed when this value changes."
;; change the buffer contents first, then fetch `candidates' for each,
;; and revert at the end. Might be error-prone.
(and
+ choice
(cl-every
(lambda (replacement)
(and
diff --git a/test/core-tests.el b/test/core-tests.el
index 45ea312171..d27be8a16d 100644
--- a/test/core-tests.el
+++ b/test/core-tests.el
@@ -357,6 +357,58 @@
(car (member "a1b" candidates))
"aa" "bcd")))))
+(ert-deftest company-multi-backend-combines-expand-common ()
+ (let* ((one (lambda (command &rest _args)
+ (cl-case command
+ (prefix '("a" ""))
+ (expand-common (cons "ab" "")))))
+ (two (lambda (command &rest _args)
+ (cl-case command
+ (prefix '("aa" "bcd"))
+ (expand-common (cons "aab" "bcd")))))
+ (tri (lambda (command &rest _args)
+ (cl-case command
+ (prefix '("aa" "bcd"))
+ (expand-common 'no-match))))
+ (company-backend (list one two tri))
+ (company-point (point)))
+ (company-call-backend 'set-min-prefix 1)
+ (should
+ (equal '("aab" . "bcd")
+ (company-call-backend 'expand-common "aa" "bcd")))))
+
+(ert-deftest company-multi-backend-expand-common-returns-no-match ()
+ (let* ((one (lambda (command &rest _args)
+ (cl-case command
+ (prefix '("a" ""))
+ (expand-common 'no-match))))
+ (two (lambda (command &rest _args)
+ (cl-case command
+ (prefix '("aa" "bcd"))
+ (expand-common 'no-match))))
+ (company-backend (list one two))
+ (company-point (point)))
+ (company-call-backend 'set-min-prefix 1)
+ (should
+ (equal 'no-match
+ (company-call-backend 'expand-common "aa" "bcd")))))
+
+(ert-deftest company-multi-backend-expand-common-keeps-current ()
+ (let* ((one (lambda (command &rest _args)
+ (cl-case command
+ (prefix '("a" ""))
+ (expand-common (cons "ab" "")))))
+ (two (lambda (command &rest _args)
+ (cl-case command
+ (prefix '("a" ""))
+ (expand-common (cons "ac" "")))))
+ (company-backend (list one two))
+ (company-point (point)))
+ (company-call-backend 'set-min-prefix 1)
+ (should
+ (equal '("a" . "")
+ (company-call-backend 'expand-common "a" "")))))
+
(ert-deftest company-begin-backend-failure-doesnt-break-company-backends ()
(with-temp-buffer
(insert "a")
- [elpa] externals/company 225d27d392 17/24: Update one test (1) and fix another (2), (continued)
- [elpa] externals/company 225d27d392 17/24: Update one test (1) and fix another (2), ELPA Syncer, 2024/08/27
- [elpa] externals/company 64a3787db7 14/24: Copy edit, ELPA Syncer, 2024/08/27
- [elpa] externals/company df4f6e9ea3 21/24: company--common-or-matches: Synchronize with 'match' more, ELPA Syncer, 2024/08/27
- [elpa] externals/company 8a4872a81b 23/24: company-capf--current-boundaries only for matching completions, ELPA Syncer, 2024/08/27
- [elpa] externals/company e1d331a64e 24/24: [ci skip] Remove parens, ELPA Syncer, 2024/08/27
- [elpa] externals/company 36aae5183a 13/24: company--multi-expand-common: Simplify the compatibility check, ELPA Syncer, 2024/08/27
- [elpa] externals/company 71fad0b38a 06/24: Delete a no-op line, ELPA Syncer, 2024/08/27
- [elpa] externals/company 4ba6dcb874 22/24: Merge pull request #1488 from company-mode/expand-common, ELPA Syncer, 2024/08/27
- [elpa] externals/company 82e7f81dcb 07/24: Support complete-common in backends with boundaries and no `expand-common`, ELPA Syncer, 2024/08/27
- [elpa] externals/company cb3b67122d 01/24: company-complete-common: Generalized "expand common" behavior, ELPA Syncer, 2024/08/27
- [elpa] externals/company 7b849c0c6f 18/24: Mo tests and some fixes,
ELPA Syncer <=
- [elpa] externals/company b2b9b19f9a 20/24: Update the NEWS entry, ELPA Syncer, 2024/08/27
- [elpa] externals/company 4647272f62 08/24: Improve the default `expand-common` implementation to support boundaries, ELPA Syncer, 2024/08/27
- [elpa] externals/company ed4a93f576 10/24: company--multi-expand-common: Analyze each backend's completions separately, ELPA Syncer, 2024/08/27