From dce3fc3e9a455426a45db072f28604b1bc63680a Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 4 Nov 2022 19:31:58 +0800 Subject: vim-patch:8.2.0540: regexp and other code not tested (#20930) Problem: Regexp and other code not tested. Solution: Add more tests. (Yegappan Lakshmanan, closes vim/vim#5904) https://github.com/vim/vim/commit/004a6781b3cf15ca5dd632c38cc09bb3b253d1f8 --- src/nvim/testdir/test_search.vim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/nvim/testdir/test_search.vim') diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim index 0cf55c7d0b..d79910fbc1 100644 --- a/src/nvim/testdir/test_search.vim +++ b/src/nvim/testdir/test_search.vim @@ -1752,6 +1752,25 @@ func Test_invalid_regexp() call assert_fails("call search('\\%#=3ab')", 'E864:') endfunc +" Test for searching a very complex pattern in a string. Should switch the +" regexp engine from NFA to the old engine. +func Test_regexp_switch_engine() + let l = readfile('samples/re.freeze.txt') + let v = substitute(l[4], '..\@\" + call assert_equal([2, 5], [line('.'), col('.')]) + exe "normal 2GVj$?\\%Vbar\\" + call assert_equal([3, 5], [line('.'), col('.')]) + close! +endfunc + " Test for searching with 'smartcase' and 'ignorecase' func Test_search_smartcase() new -- cgit