mirror of
https://github.com/vim/vim.git
synced 2025-08-24 19:45:50 -04:00
patch 8.0.0940: Test_terminal_scrape_multibyte is flaky
Problem: Test_terminal_scrape_multibyte is flaky. (James McCoy) Solution: Use WaitFor() instead of term_wait().
This commit is contained in:
parent
51c23687a9
commit
c08706135d
@ -189,15 +189,10 @@ func Test_terminal_scrape_multibyte()
|
|||||||
else
|
else
|
||||||
let cmd = "cat Xtext"
|
let cmd = "cat Xtext"
|
||||||
endif
|
endif
|
||||||
let buf = term_start(cmd)
|
let g:buf = term_start(cmd)
|
||||||
|
|
||||||
call term_wait(buf)
|
call WaitFor('term_scrape(g:buf, 1)[0].chars == "l"')
|
||||||
if has('win32')
|
let l = term_scrape(g:buf, 1)
|
||||||
" TODO: this should not be needed
|
|
||||||
sleep 100m
|
|
||||||
endif
|
|
||||||
|
|
||||||
let l = term_scrape(buf, 1)
|
|
||||||
call assert_true(len(l) >= 7)
|
call assert_true(len(l) >= 7)
|
||||||
call assert_equal('l', l[0].chars)
|
call assert_equal('l', l[0].chars)
|
||||||
call assert_equal('é', l[1].chars)
|
call assert_equal('é', l[1].chars)
|
||||||
@ -209,11 +204,12 @@ func Test_terminal_scrape_multibyte()
|
|||||||
call assert_equal('r', l[5].chars)
|
call assert_equal('r', l[5].chars)
|
||||||
call assert_equal('s', l[6].chars)
|
call assert_equal('s', l[6].chars)
|
||||||
|
|
||||||
let g:job = term_getjob(buf)
|
let g:job = term_getjob(g:buf)
|
||||||
call WaitFor('job_status(g:job) == "dead"')
|
call WaitFor('job_status(g:job) == "dead"')
|
||||||
call term_wait(buf)
|
call term_wait(g:buf)
|
||||||
|
|
||||||
exe buf . 'bwipe'
|
exe g:buf . 'bwipe'
|
||||||
|
unlet g:buf
|
||||||
call delete('Xtext')
|
call delete('Xtext')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@ -409,16 +405,17 @@ func Test_terminal_env()
|
|||||||
if !has('unix')
|
if !has('unix')
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let buf = Run_shell_in_terminal({'env': {'TESTENV': 'correct'}})
|
let g:buf = Run_shell_in_terminal({'env': {'TESTENV': 'correct'}})
|
||||||
" Wait for the shell to display a prompt
|
" Wait for the shell to display a prompt
|
||||||
call WaitFor('term_getline(1) != ""')
|
call WaitFor('term_getline(g:buf, 1) != ""')
|
||||||
call term_sendkeys(buf, "echo $TESTENV\r")
|
call term_sendkeys(g:buf, "echo $TESTENV\r")
|
||||||
call term_wait(buf)
|
call term_wait(g:buf)
|
||||||
call Stop_shell_in_terminal(buf)
|
call Stop_shell_in_terminal(g:buf)
|
||||||
call WaitFor('getline(2) == "correct"')
|
call WaitFor('getline(2) == "correct"')
|
||||||
call assert_equal('correct', getline(2))
|
call assert_equal('correct', getline(2))
|
||||||
|
|
||||||
exe buf . 'bwipe'
|
exe g:buf . 'bwipe'
|
||||||
|
unlet g:buf
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" must be last, we can't go back from GUI to terminal
|
" must be last, we can't go back from GUI to terminal
|
||||||
|
@ -769,6 +769,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 */
|
||||||
|
/**/
|
||||||
|
940,
|
||||||
/**/
|
/**/
|
||||||
939,
|
939,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user