diff options
Diffstat (limited to 'src/testdir/test_search.vim')
-rw-r--r-- | src/testdir/test_search.vim | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim index 074ab15467..ef44751659 100644 --- a/src/testdir/test_search.vim +++ b/src/testdir/test_search.vim @@ -1411,6 +1411,22 @@ func Test_subst_word_under_cursor() set noincsearch endfunc +func Test_search_skip_all_matches() + enew + call setline(1, ['no match here', + \ 'match this line', + \ 'nope', + \ 'match in this line', + \ 'last line', + \ ]) + call cursor(1, 1) + let lnum = search('this', '', 0, 0, 'getline(".") =~ "this line"') + " Only check that no match is found. Previously it searched forever. + call assert_equal(0, lnum) + + bwipe! +endfunc + func Test_search_undefined_behaviour() CheckFeature terminal |