]> code.delx.au - gnu-emacs-elpa/blobdiff - ivy-test.el
counsel-ag now works with ivy-occur-revert-buffer
[gnu-emacs-elpa] / ivy-test.el
index 807f8ada4f2bd3f1a1d53505b8b9c739da0209a4..866eaa722c05a8222ea15df279734cf41ad4ddef 100644 (file)
                   "and  I  am"
                    "your  king."))))
 
+(ert-deftest ivy--regex ()
+  (should (equal (ivy--regex
+                  "\\(?:interactive\\|swiper\\) \\(?:list\\|symbol\\)")
+                 "\\(\\(?:interactive\\|swiper\\)\\).*?\\(\\(?:list\\|symbol\\)\\)")))
+
 (ert-deftest ivy--regex-fuzzy ()
   (should (string= (ivy--regex-fuzzy "tmux")
                    "\\(t\\).*\\(m\\).*\\(u\\).*\\(x\\)"))
 
 (ert-deftest ivy--format ()
   (should (string= (let ((ivy--index 10)
-                         (ivy-format-function (lambda (x) (mapconcat (lambda (y) (car y)) x "\n")))
+                         (ivy-format-function (lambda (x) (mapconcat #'identity x "\n")))
                          (cands '("NAME"
                                   "SYNOPSIS"
                                   "DESCRIPTION"
 (ert-deftest counsel-unquote-regex-parens ()
   (should (equal (counsel-unquote-regex-parens
                   (ivy--regex "foo bar"))
-                 "(foo).*?(bar)")))
+                 "(foo).*?(bar)"))
+  (should (equal (counsel-unquote-regex-parens
+                  (ivy--regex "(foo bar"))
+                 "(\\(foo).*?(bar)")))