[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 0a4ad42 047/399: ivy-test.el (counsel--grep-regex): Add te
From: |
Oleh Krehel |
Subject: |
[elpa] master 0a4ad42 047/399: ivy-test.el (counsel--grep-regex): Add test for negative lookahead |
Date: |
Sat, 20 Jul 2019 14:56:46 -0400 (EDT) |
branch: master
commit 0a4ad4219b59e2b63dc914bf1dc23a81d2635b18
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy-test.el (counsel--grep-regex): Add test for negative lookahead
Re #1935
---
ivy-test.el | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/ivy-test.el b/ivy-test.el
index 12c1077..2098194 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -344,7 +344,10 @@ will bring the behavior in line with the newer Emacsen."
"bar.*baz"))
(should (equal (counsel--elisp-to-pcre
'(("foo\\|bar" . t) ("blah\\|bloop") ("blick" . t)
("\\(baz\\)\\|quux" . t)))
- "(?:foo|bar).*blick.*(?:(baz)|quux)")))
+ "(?:foo|bar).*blick.*(?:(baz)|quux)"))
+ (should (equal (counsel--elisp-to-pcre
+ '(("ivy" . t) ("-")) t)
+ "(?=.*ivy)(?!.*-)")))
(defmacro ivy--string-buffer (text &rest body)
"Test helper that wraps TEXT in a temp buffer while running BODY."
@@ -979,6 +982,15 @@ a buffer visiting a file."
(should (equal out expected))
(should (equal match-data-orig (match-data)))))))
+(ert-deftest counsel--grep-regex ()
+ ;; negative lookahead: lines with "ivy", without "-"
+ (should
+ (string=
+ (let ((counsel--regex-look-around t)
+ (ivy--regex-function 'ivy--regex-plus))
+ (counsel--grep-regex "ivy ! -"))
+ "(?=.*ivy)(?!.*-)")))
+
(provide 'ivy-test)
;;; ivy-test.el ends here
- [elpa] master c38daa3 039/399: Enable counsel-read-env to work in read-file-name, (continued)
- [elpa] master c38daa3 039/399: Enable counsel-read-env to work in read-file-name, Oleh Krehel, 2019/07/20
- [elpa] master e88c7d6 044/399: counsel.el (counsel-locate-cmd): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master 51c5874 042/399: counsel.el (counsel-find-file-map): Bind "`" to bookmarks, Oleh Krehel, 2019/07/20
- [elpa] master 3de074a 049/399: counsel.el (counsel-find-file-copy): Add and bind., Oleh Krehel, 2019/07/20
- [elpa] master a538df1 053/399: ivy.el (ivy-make-magic-action): Point doc to the action function, Oleh Krehel, 2019/07/20
- [elpa] master 84b5ece 050/399: counsel.el (counsel-find-file-copy): Use ivy-inhibit-action, Oleh Krehel, 2019/07/20
- [elpa] master 9e3c855 052/399: ivy.el (ivy-make-magic-action): Fix bug, Oleh Krehel, 2019/07/20
- [elpa] master 9cf3f08 045/399: swiper.el (swiper-use-visual-line-p): New variable, Oleh Krehel, 2019/07/20
- [elpa] master 15e2c88 051/399: Restore buffer-list after counsel-switch-buffers, Oleh Krehel, 2019/07/20
- [elpa] master 80d40e4 046/399: Dynamically handle grep tool look-arounds, Oleh Krehel, 2019/07/20
- [elpa] master 0a4ad42 047/399: ivy-test.el (counsel--grep-regex): Add test for negative lookahead,
Oleh Krehel <=
- [elpa] master 5f4e944 057/399: counsel.el: Fix finding dominating file, Oleh Krehel, 2019/07/20
- [elpa] master 3c16fa1 055/399: counsel.el (counsel-compile): Clean up, Oleh Krehel, 2019/07/20
- [elpa] master 876b4ac 059/399: counsel.el (counsel-compile): Minor cleanup, Oleh Krehel, 2019/07/20
- [elpa] master 56201b1 056/399: counsel.el: Remove cl-extra, Oleh Krehel, 2019/07/20
- [elpa] master 859e3cb 061/399: counsel.el: Clean up compile history keeping, Oleh Krehel, 2019/07/20
- [elpa] master 072f238 058/399: counsel.el: Capitalize proper noun "Git", Oleh Krehel, 2019/07/20
- [elpa] master 5f5a263 054/399: counsel.el (counsel-compile): Add, Oleh Krehel, 2019/07/20
- [elpa] master adea72f 060/399: counsel.el: Simplify counsel-compile action, Oleh Krehel, 2019/07/20
- [elpa] master 50dc9e6 065/399: counsel.el (counsel--get-build-subdirs): Fix, Oleh Krehel, 2019/07/20
- [elpa] master 4e0d403 066/399: counsel.el (counsel--find-build-subdir): Simplify, Oleh Krehel, 2019/07/20