]> code.delx.au - gnu-emacs-elpa/blobdiff - ivy-test.el
Allow user-specified matched candidate sorting
[gnu-emacs-elpa] / ivy-test.el
index 5c773946726d354932af60d5cd2f928642c6bf03..ddfef347ea3350fb248555666065942c7bc0012b 100644 (file)
   (should (equal
            (ivy-with '(ivy-read "test" '("aaab" "aaac"))
                      "a C-n <tab> C-m")
-           "aaac")))
+           "aaac"))
+  (should (equal
+           (ivy-with '(ivy-read "pattern: " '("can do" "can" "can't do"))
+                     "can C-m")
+           "can")))
 
 (ert-deftest swiper--re-builder ()
   (setq swiper--width 4)
   (should (string= (swiper--re-builder "^")
                    "."))
   (should (string= (swiper--re-builder "^a")
-                   "^[0-9][0-9 ]\\{4\\}\\(a\\)"))
+                   "^ ?\\(a\\)"))
   (should (string= (swiper--re-builder "^a b")
-                   "^[0-9][0-9 ]\\{4\\}\\(a\\).*?\\(b\\)")))
+                   "^ \\(a\\).*?\\(b\\)")))
 
 (ert-deftest ivy--split ()
   (should (equal (ivy--split "King of the who?")