diff options
Diffstat (limited to 'src/nvim/testdir/test_search.vim')
-rw-r--r-- | src/nvim/testdir/test_search.vim | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim index 08ccc8d4fe..f4fe4051e3 100644 --- a/src/nvim/testdir/test_search.vim +++ b/src/nvim/testdir/test_search.vim @@ -585,3 +585,27 @@ func Test_one_error_msg() " This was also giving an internal error call assert_fails('call search(" \\((\\v[[=P=]]){185}+ ")', 'E871:') endfunc + +" Test for the search() function with match at the cursor position +func Test_search_match_at_curpos() + new + call append(0, ['foobar', '', 'one two', '']) + + normal gg + + call search('foobar', 'c') + call assert_equal([1, 1], [line('.'), col('.')]) + + normal j + call search('^$', 'c') + call assert_equal([2, 1], [line('.'), col('.')]) + + call search('^$', 'bc') + call assert_equal([2, 1], [line('.'), col('.')]) + + exe "normal /two\<CR>" + call search('.', 'c') + call assert_equal([3, 5], [line('.'), col('.')]) + + close! +endfunc |