0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.2.1497: CursorHold test is flaky

Problem:    CursorHold test is flaky. (Jakub Kądziołka)
Solution:   Use WaitForAssert() (closes #6754)
This commit is contained in:
Bram Moolenaar
2020-08-20 18:29:13 +02:00
parent b8a9296ced
commit 17f67547f3
2 changed files with 7 additions and 6 deletions

View File

@@ -29,20 +29,19 @@ func Test_CursorHold_autocmd()
END END
call writefile(before, 'Xinit') call writefile(before, 'Xinit')
let buf = RunVimInTerminal('-S Xinit Xfile', {}) let buf = RunVimInTerminal('-S Xinit Xfile', {})
call term_wait(buf) call term_sendkeys(buf, "G")
call term_wait(buf, 20)
call term_sendkeys(buf, "gg") call term_sendkeys(buf, "gg")
call term_wait(buf) call term_wait(buf)
sleep 50m call WaitForAssert({-> assert_equal(['1'], readfile('Xoutput')[-1:-1])})
call term_sendkeys(buf, "j") call term_sendkeys(buf, "j")
call term_wait(buf) call term_wait(buf)
sleep 50m call WaitForAssert({-> assert_equal(['1', '2'], readfile('Xoutput')[-2:-1])})
call term_sendkeys(buf, "j") call term_sendkeys(buf, "j")
call term_wait(buf) call term_wait(buf)
sleep 50m call WaitForAssert({-> assert_equal(['1', '2', '3'], readfile('Xoutput')[-3:-1])})
call StopVimInTerminal(buf) call StopVimInTerminal(buf)
call assert_equal(['1', '2', '3'], readfile('Xoutput')[-3:-1])
call delete('Xinit') call delete('Xinit')
call delete('Xoutput') call delete('Xoutput')
call delete('Xfile') call delete('Xfile')

View File

@@ -754,6 +754,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 */
/**/
1497,
/**/ /**/
1496, 1496,
/**/ /**/