mirror of
https://github.com/vim/vim.git
synced 2025-10-01 04:54:07 -04:00
patch 8.2.2512: Vim9: compiling error test sometimes fails
Problem: Vim9: compiling error test sometimes fails. Solution: use WaitForAssert() instead of sleeping for a bit. (Dominique Pellé, closes #7837)
This commit is contained in:
@@ -179,5 +179,9 @@ func Run_shell_in_terminal(options)
|
|||||||
return buf
|
return buf
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Return concatenated lines in terminal.
|
||||||
|
func Term_getlines(buf, lines)
|
||||||
|
return join(map(a:lines, 'term_getline(a:buf, v:val)'), '')
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@@ -31,18 +31,8 @@ def TestCompilingError()
|
|||||||
call writefile(lines, 'XTest_compile_error')
|
call writefile(lines, 'XTest_compile_error')
|
||||||
var buf = RunVimInTerminal('-S XTest_compile_error',
|
var buf = RunVimInTerminal('-S XTest_compile_error',
|
||||||
{rows: 10, wait_for_ruler: 0})
|
{rows: 10, wait_for_ruler: 0})
|
||||||
var text = ''
|
call WaitForAssert(() => assert_match('Error detected while compiling command line.*Fails.*Variable not found: nothing',
|
||||||
for loop in range(100)
|
Term_getlines(buf, range(1, 9))))
|
||||||
text = ''
|
|
||||||
for i in range(1, 9)
|
|
||||||
text ..= term_getline(buf, i)
|
|
||||||
endfor
|
|
||||||
if text =~ 'Variable not found: nothing'
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
sleep 20m
|
|
||||||
endfor
|
|
||||||
assert_match('Error detected while compiling command line.*Fails.*Variable not found: nothing', text)
|
|
||||||
|
|
||||||
# clean up
|
# clean up
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
|
@@ -755,7 +755,7 @@ def Test_throw_vimscript()
|
|||||||
enddef
|
enddef
|
||||||
|
|
||||||
def Test_error_in_nested_function()
|
def Test_error_in_nested_function()
|
||||||
# an error in a nested :function aborts executin in the calling :def function
|
# an error in a nested :function aborts executing in the calling :def function
|
||||||
var lines =<< trim END
|
var lines =<< trim END
|
||||||
vim9script
|
vim9script
|
||||||
def Func()
|
def Func()
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2512,
|
||||||
/**/
|
/**/
|
||||||
2511,
|
2511,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user