Permalink
Browse files

patch 8.0.0644: the timeout for 'hlsearch' is not tested

Problem:    There is no test for 'hlsearch' timing out.
Solution:   Add a test.
  • Loading branch information...
brammool committed Jun 17, 2017
1 parent fbd0b0a commit 5b1affefd0e96154517ec6f71300086ae6d22d24
Showing with 20 additions and 0 deletions.
  1. +18 −0 src/testdir/test_hlsearch.vim
  2. +2 −0 src/version.c
@@ -32,3 +32,21 @@ function! Test_hlsearch()
call getchar(1)
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
View
@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
644,
/**/
643,
/**/

0 comments on commit 5b1affe

Please sign in to comment.