call search('.', 'c')
call assert_equal([3, 5], [line('.'), col('.')])
- close!
+ bw!
endfunc
" Test for error cases with the search() function
call assert_fails('normal n', 'E385:')
call assert_fails('normal N', 'E384:')
set wrapscan&
- close
+ bw
endfunc
" Test for v:searchforward variable
let v:searchforward = 1
normal N
call assert_equal(1, line('.'))
- close!
+ bw!
endfunc
" Test for invalid regular expressions
call assert_equal([2, 5], [line('.'), col('.')])
exe "normal 2GVj$?\\%Vbar\<CR>\<Esc>"
call assert_equal([3, 5], [line('.'), col('.')])
- close!
+ bw!
endfunc
" Test for searching with 'smartcase' and 'ignorecase'
call assert_equal([2, 4], [line('.'), col('.')])
set ignorecase& smartcase&
- close!
+ bw!
endfun
" Test 'smartcase' with utf-8.
exe "normal /four/e+1\<CR>"
call assert_equal([2, 10], [line('.'), col('.')])
- close!
+ bw!
endfunc
" Test for searching for matching parenthesis using %
normal 20|%
call assert_equal(4, col('.'))
set virtualedit&
- close!
+ bw!
endfunc
" Test for searching a pattern and stopping before a specified line
call cursor(4, 1)
call assert_equal(0, search('vim', 'bn', 2))
call assert_equal(1, search('vim', 'bn', 1))
- close!
+ bw!
endfunc
func Test_incsearch_highlighting_newline()