mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.0.0644: the timeout for 'hlsearch' is not tested
Problem: There is no test for 'hlsearch' timing out.
Solution: Add a test.
5b1affefd0
This commit is contained in:
parent
241b905b13
commit
570e41fc08
@ -32,6 +32,24 @@ function! Test_hlsearch()
|
||||
enew!
|
||||
endfunction
|
||||
|
||||
func Test_hlsearch_hangs()
|
||||
if !has('reltime') || !has('float')
|
||||
return
|
||||
endif
|
||||
|
||||
" This pattern takes forever to match, it should timeout.
|
||||
help
|
||||
let start = reltime()
|
||||
set hlsearch nolazyredraw redrawtime=101
|
||||
let @/ = '\%#=2\v(a|\1)*'
|
||||
redraw
|
||||
let elapsed = reltimefloat(reltime(start))
|
||||
call assert_true(elapsed > 0.1)
|
||||
call assert_true(elapsed < 1.0)
|
||||
set nohlsearch redrawtime&
|
||||
quit
|
||||
endfunc
|
||||
|
||||
func Test_hlsearch_eol_highlight()
|
||||
new
|
||||
call append(1, repeat([''], 9))
|
||||
|
Loading…
Reference in New Issue
Block a user