diff options
| author | Tom Dalziel <tom_dl@hotmail.com> | 2024-05-06 17:00:18 +0200 |
|---|---|---|
| committer | Tom Dalziel <33435574+tomdl89@users.noreply.github.com> | 2024-05-06 17:05:28 +0200 |
| commit | a8b28f57f78255378c37c6d5ef1f2c7a45bc499b (patch) | |
| tree | bfc62a931f58d92f9b5a8a1344b9a4b55d0ceb05 /evil-tests.el | |
| parent | 76667a1a46d896d673f51f7f5782125d06b3a022 (diff) | |
Backreferences in vim-style regexp
Fixes #1895
Diffstat (limited to 'evil-tests.el')
| -rw-r--r-- | evil-tests.el | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/evil-tests.el b/evil-tests.el index 89bc497..dcf8fce 100644 --- a/evil-tests.el +++ b/evil-tests.el @@ -8319,7 +8319,24 @@ golf h[o]>tel"))) "alpha [b]ravo charlie delta bravo echo" ("/\C-w" [return]) "alpha bravo charlie delta [b]ravo echo") - (custom-set-variables `(evil-want-C-w-delete ,old-val)))))) + (custom-set-variables `(evil-want-C-w-delete ,old-val)))) + (ert-info ("Can use backreferences with vim-style regexp") + (let ((evil-ex-search-vim-style-regexp t)) + (evil-test-buffer + "[a]bacababcacabccadefghij" + ;; Very magic + ("/\\v(.)(.)(.)\\3\\1/e" [return]) + "abacababcacabcc[a]defghij") + (evil-test-buffer + "[a]bacababcacabccadefghij" + ;; Default magic + ("/\\(.\\)\\(.\\)\\(.\\)\\3\\1/e" [return]) + "abacababcacabcc[a]defghij") + (evil-test-buffer + "[a]bacababcac1abcca1defghij" + ;; With literal numbers + ("/\\(.\\)\\(.\\)\\(.\\)\\3\\11/e" [return]) + "abacababcac1abcca[1]defghij"))))) (ert-deftest evil-test-ex-search-offset () "Test search offsets." |
