]> code.delx.au - gnu-emacs-elpa/blobdiff - test/frontends-tests.el
Remove completions without annotations when considering duplicates
[gnu-emacs-elpa] / test / frontends-tests.el
index 613856e57418c2a7ee298b5ed786f3a3e7343800..7348cbde967b1f6154bf2092d40b643e43db8151 100644 (file)
@@ -36,7 +36,7 @@
         (let (this-command)
           (company-call 'complete))
         (company-call 'open-line 1)
-        (should (eq 1 (overlay-start company-pseudo-tooltip-overlay)))))))
+        (should (eq 2 (overlay-start company-pseudo-tooltip-overlay)))))))
 
 (ert-deftest company-pseudo-tooltip-show ()
   :tags '(interactive)
@@ -57,7 +57,7 @@
         (should (eq (overlay-get ov 'company-height) company-tooltip-limit))
         (should (eq (overlay-get ov 'company-column) col))
         (should (string= (overlay-get ov 'company-display)
-                         "\n  123 \nc 45  c\nddd\n")))))))
+                         "  123 \nc 45  c\nddd\n")))))))
 
 (ert-deftest company-pseudo-tooltip-edit-updates-width ()
   :tags '(interactive)
           ;; With margins.
           (should (eq (overlay-get ov 'company-width) 8))
           (should (string= (overlay-get ov 'company-display)
-                           "\n 123(4) \n 45     \n")))))))
+                           " 123(4) \n 45     \n")))))))
 
 (ert-deftest company-pseudo-tooltip-show-with-annotations-right-aligned ()
   :tags '(interactive)
           ;; With margins.
           (should (eq (overlay-get ov 'company-width) 13))
           (should (string= (overlay-get ov 'company-display)
-                           "\n 123     (4) \n 45          \n 67 (891011) \n")))))))
+                           " 123     (4) \n 45          \n 67 (891011) \n")))))))
 
 (ert-deftest company-create-lines-shows-numbers ()
   (let ((company-show-numbers t)
     (insert (propertize "a" 'display "bbb\nccc\ndddd\n"))
     (insert "eee\nfff\nggg")
     (should (equal (company-buffer-lines (point-min) (point-max))
-                   '("" "" "" "eee" "fff" "ggg")))))
+                   '("a" "" "" "eee" "fff" "ggg")))))
 
 (ert-deftest company-buffer-lines-with-multiline-after-string-at-eob ()
   :tags '(interactive)
     (should (equal (company-buffer-lines (point-min) (point-max))
                    '("a" "b" "c")))))
 
+(ert-deftest company-buffer-lines-with-line-wrapping ()
+  :tags '(interactive)
+  (with-temp-buffer
+    (let ((ww (company--window-width)))
+      (insert (make-string (* 3 ww) ?a))
+      (should (equal (company-buffer-lines (point-min) (point-max))
+                     (list (make-string ww ?a)
+                           (make-string ww ?a)
+                           (make-string ww ?a)))))))
+
 (ert-deftest company-modify-line ()
   (let ((str "-*-foobar"))
     (should (equal-including-properties