From 004a6781b3cf15ca5dd632c38cc09bb3b253d1f8 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 11 Apr 2020 17:09:31 +0200 Subject: patch 8.2.0540: regexp and other code not tested Problem: Regexp and other code not tested. Solution: Add more tests. (Yegappan Lakshmanan, closes #5904) --- src/testdir/test_search.vim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/testdir/test_search.vim') diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim index 29943df99d..923a082b18 100644 --- a/src/testdir/test_search.vim +++ b/src/testdir/test_search.vim @@ -1593,4 +1593,23 @@ 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 + " vim: shiftwidth=2 sts=2 expandtab -- cgit v1.2.3