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

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

[elpa] externals/company ced9088 2/6: Add GUI-only test


From: ELPA Syncer
Subject: [elpa] externals/company ced9088 2/6: Add GUI-only test
Date: Fri, 26 Mar 2021 21:57:09 -0400 (EDT)

branch: externals/company
commit ced90884785b5111efb22522048300a8081722cc
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    Add GUI-only test
    
    #1070
---
 Makefile                |  6 +++++-
 test/frontends-tests.el | 24 +++++++++++++++++++++++-
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 015f3ac..9357506 100644
--- a/Makefile
+++ b/Makefile
@@ -21,11 +21,15 @@ clean:
 
 test:
        ${EMACS} -Q -nw -L . -l test/all.el \
+       --eval "(let (pop-up-windows) (ert '(not (tag gui))))"
+
+test-gui:
+       ${EMACS} -Q -L . -l test/all.el \
        --eval "(let (pop-up-windows) (ert t))"
 
 test-batch:
        ${EMACS} -Q --batch -L . -l test/all.el \
-       --eval "(ert-run-tests-batch-and-exit '(not (tag interactive)))"
+       --eval "(ert-run-tests-batch-and-exit '(not (or (tag interactive) (tag 
gui))))"
 
 compile:
        ${EMACS} -Q --batch -L . -f batch-byte-compile company.el company-*.el
diff --git a/test/frontends-tests.el b/test/frontends-tests.el
index 7ece53a..396b854 100644
--- a/test/frontends-tests.el
+++ b/test/frontends-tests.el
@@ -256,7 +256,6 @@
                    (company--create-lines 0 999)))))
 
 (ert-deftest company-create-lines-with-format-function ()
-  :tags '(interactive)
   (let* (company-show-numbers
          (company-candidates '("ArrayList"))
          (company-candidates-length 1)
@@ -270,6 +269,29 @@
                (face (company-tooltip-selection company-tooltip)
                      mouse-face (company-tooltip-mouse)))))))
 
+(ert-deftest company-create-lines-with-icons-format-function ()
+  :tags '(gui)
+  (let* (company-show-numbers
+         (company-candidates '("ArrayList"))
+         (company-candidates-length 1)
+         (default-directory company-package-root)
+         (company-tooltip-maximum-width 20)
+         (company-tooltip-minimum-width 20)
+         (company-format-margin-function
+          'company-vscode-light-icons-margin-function)
+         (company-backend (lambda (c &rest _) (pcase c (`kind 'class)))))
+    (let ((tooltip-line (car (company--create-lines 0 999))))
+      (should (equal tooltip-line "  ArrayList            "))
+      (should (equal
+               (car (get-text-property 1 'display tooltip-line))
+               'space))
+      (should (equal
+               (get-text-property 0 'display tooltip-line)
+               `(image :file ,(expand-file-name 
"vscode-light/symbol-class.png")
+                       :type png :width 15 :height 15 :ascent center
+                       :background ,(face-attribute 'company-tooltip-selection
+                                                    :background)))))))
+
 (ert-deftest company-fill-propertize-truncates-search-highlight ()
   (let ((company-search-string "foo")
         (company-backend #'ignore)



reply via email to

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