]> code.delx.au - gnu-emacs-elpa/blobdiff - test/core-tests.el
Remove completions without annotations when considering duplicates
[gnu-emacs-elpa] / test / core-tests.el
index 13e547e3d36b15ac566ad3dcc9119ea675a7c580..dcadfd3ab70f6f74d5da8fe592948748a251ebe4 100644 (file)
                 ("a" . "b")
                 ("a" . "c")
                 ("a" . "b")
-                ("b" . "c")
                 ("b" . nil)
-                ("a" . "b")))
+                ("b" . "c")
+                ("a" . "b")
+                ("c" . nil)
+                ("c" . nil)))
          (fn (lambda (kvs)
                (mapcar (lambda (kv) (propertize (car kv) 'ann (cdr kv)))
                        kvs)))
               (`duplicates t)
               (`annotation (get-text-property 0 'ann arg)))))
          (reference '(("a" . "b")
-                      ("a" . nil)
                       ("a" . "c")
                       ("b" . "c")
-                      ("b" . nil)
-                      ("a" . "b"))))
+                      ("a" . "b")
+                      ("c" . nil))))
     (let ((ct-sorted t))
       (should (ct-equal-including-properties
                (company--preprocess-candidates (funcall fn kvs))
                (funcall fn reference))))
     (should (ct-equal-including-properties
              (company--preprocess-candidates (funcall fn kvs))
-             (funcall fn (butlast reference))))))
+             (funcall fn (append (butlast reference 2)
+                                 (last reference)))))))
 
 ;;; Row and column