mirror of
https://github.com/neovim/neovim.git
synced 2025-10-13 13:26:06 +00:00
vim-patch:8.2.1497: CursorHold test is flaky (#21095)
Problem: CursorHold test is flaky. (Jakub Kądziołka)
Solution: Use WaitForAssert() (closes vim/vim#6754)
17f67547f3
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -31,20 +31,19 @@ func Test_CursorHold_autocmd()
|
||||
END
|
||||
call writefile(before, 'Xinit')
|
||||
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_wait(buf)
|
||||
sleep 50m
|
||||
call WaitForAssert({-> assert_equal(['1'], readfile('Xoutput')[-1:-1])})
|
||||
call term_sendkeys(buf, "j")
|
||||
call term_wait(buf)
|
||||
sleep 50m
|
||||
call WaitForAssert({-> assert_equal(['1', '2'], readfile('Xoutput')[-2:-1])})
|
||||
call term_sendkeys(buf, "j")
|
||||
call term_wait(buf)
|
||||
sleep 50m
|
||||
call WaitForAssert({-> assert_equal(['1', '2', '3'], readfile('Xoutput')[-3:-1])})
|
||||
call StopVimInTerminal(buf)
|
||||
|
||||
call assert_equal(['1', '2', '3'], readfile('Xoutput')[-3:-1])
|
||||
|
||||
call delete('Xinit')
|
||||
call delete('Xoutput')
|
||||
call delete('Xfile')
|
||||
|
Reference in New Issue
Block a user