[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 668e4b0 22/31: Merge pull request #880 from joaotavora/fix
From: |
Dmitry Gutov |
Subject: |
[elpa] master 668e4b0 22/31: Merge pull request #880 from joaotavora/fix-tests-with-arbitrary-completion-properties |
Date: |
Sun, 14 Apr 2019 22:06:19 -0400 (EDT) |
branch: master
commit 668e4b05008c69ed74179be2634353f7810a1d17
Merge: f965786 1974d83
Author: Dmitry Gutov <address@hidden>
Commit: GitHub <address@hidden>
Merge pull request #880 from
joaotavora/fix-tests-with-arbitrary-completion-properties
Make tests resilient to arbitrary text properties in completions
---
test/capf-tests.el | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/test/capf-tests.el b/test/capf-tests.el
index c8d4202..80a204d 100644
--- a/test/capf-tests.el
+++ b/test/capf-tests.el
@@ -26,6 +26,7 @@
(require 'company-tests)
(require 'company-capf)
+(require 'cl-lib)
(defmacro company-capf-with-buffer (contents &rest body)
(declare (indent 0) (debug (sexp &rest form)))
@@ -55,6 +56,19 @@
(should company-candidates)
(should (member "with-current-buffer" company-candidates))))
+(defun company--remove-but-these-properties (string keep)
+ "Remove from STRING all text properties but the ones in KEEP."
+ (remove-list-of-text-properties
+ 0 (length string)
+ (cl-set-difference
+ (cl-loop for start = 0 then (next-property-change start string)
+ while start
+ append (cl-loop for (k _v) on (text-properties-at start string)
+ by #'cddr collect k))
+ keep)
+ string)
+ string)
+
(ert-deftest company-basic-capf-highlighting ()
"Test basic `company-capf' support, with basic prefix completion."
(company-capf-with-buffer
@@ -66,10 +80,8 @@
(render
(and cand
(company-fill-propertize cand nil (length cand) nil nil
nil))))
- ;; remove `font-lock-face' and `mouse-face' text properties that aren't
- ;; relevant to our test
- (remove-list-of-text-properties
- 0 (length cand) '(font-lock-face mouse-face) render)
+ ;; remove text properties that aren't relevant to our test
+ (company--remove-but-these-properties render '(face))
(should
(ert-equal-including-properties
render
@@ -99,10 +111,8 @@
(render
(and cand
(company-fill-propertize cand nil (length cand) nil nil
nil))))
- ;; remove `font-lock-face' and `mouse-face' text properties that aren't
- ;; relevant to our test
- (remove-list-of-text-properties
- 0 (length cand) '(font-lock-face mouse-face) render)
+ ;; remove text properties that aren't relevant to our test
+ (company--remove-but-these-properties render '(face))
(should
(ert-equal-including-properties
render
@@ -125,10 +135,8 @@
(render
(and cand
(company-fill-propertize cand nil (length cand) nil nil
nil))))
- ;; remove `font-lock-face' and `mouse-face' text properties that aren't
- ;; relevant to our test
- (remove-list-of-text-properties
- 0 (length cand) '(font-lock-face mouse-face) render)
+ ;; remove text properties that aren't relevant to our test
+ (company--remove-but-these-properties render '(face))
(should
(ert-equal-including-properties
render
- [elpa] master 5bd5745 24/31: Merge pull request #883 from nikital/tng-document-no-post-completion, (continued)
- [elpa] master 5bd5745 24/31: Merge pull request #883 from nikital/tng-document-no-post-completion, Dmitry Gutov, 2019/04/14
- [elpa] master 03fa690 27/31: Merge pull request #886 from cburn11/update-company-clang--completetion-pattern, Dmitry Gutov, 2019/04/14
- [elpa] master 23136d3 28/31: Update copyright years, Dmitry Gutov, 2019/04/14
- [elpa] master 87509b1 19/31: company-complete: Don't change last-command if completion exited, Dmitry Gutov, 2019/04/14
- [elpa] master edbb3c5 16/31: Merge branch 'master' of github.com:company-mode/company-mode, Dmitry Gutov, 2019/04/14
- [elpa] master ebc4fce 17/31: Make company-idle-delay support predicate function, Dmitry Gutov, 2019/04/14
- [elpa] master 20fe015 18/31: Merge pull request #874 from amosbird/master, Dmitry Gutov, 2019/04/14
- [elpa] master f965786 20/31: company-complete: Ensure last command was really the same, Dmitry Gutov, 2019/04/14
- [elpa] master 1974d83 21/31: Make tests resilient to arbitrary text properties in completions, Dmitry Gutov, 2019/04/14
- [elpa] master 2482223 23/31: company-tng: Document post-completion and yasnippet issues, Dmitry Gutov, 2019/04/14
- [elpa] master 668e4b0 22/31: Merge pull request #880 from joaotavora/fix-tests-with-arbitrary-completion-properties,
Dmitry Gutov <=
- [elpa] master 5dab70d 26/31: update regex template to match (InBase) declarations, Dmitry Gutov, 2019/04/14
- [elpa] master 5569424 25/31: Revert "company-clang: Skip over identity preprocessor #defines", Dmitry Gutov, 2019/04/14
- [elpa] master d200fed 29/31: Update NEWS for the latest change, Dmitry Gutov, 2019/04/14
- [elpa] master 3eda0ba 30/31: Release 0.9.10, Dmitry Gutov, 2019/04/14
- [elpa] master 5deda28 31/31: Merge commit '3eda0ba23921d43b733f7975e56d490a34b9f30b' from company, Dmitry Gutov, 2019/04/14