1
0
forked from aniani/vim

patch 8.2.1498: on slow systems tests can be flaky

Problem:    On slow systems tests can be flaky.
Solution:   Use TermWait() instead of term-wait(). (Yegappan Lakshmanan,
            closes #6756)
This commit is contained in:
Bram Moolenaar
2020-08-20 18:59:06 +02:00
parent 17f67547f3
commit 733d259a83
8 changed files with 39 additions and 37 deletions

View File

@@ -268,9 +268,9 @@ func Test_write_file_mtime()
call writefile(["Line1", "Line2"], 'Xfile')
let old_ftime = getftime('Xfile')
let buf = RunVimInTerminal('Xfile', #{rows : 10})
call term_wait(buf)
call TermWait(buf)
call term_sendkeys(buf, ":set noswapfile\<CR>")
call term_wait(buf)
call TermWait(buf)
" Modify the file directly. Make sure the file modification time is
" different. Note that on Linux/Unix, the file is considered modified
@@ -286,17 +286,17 @@ func Test_write_file_mtime()
" Try to overwrite the file and check for the prompt
call term_sendkeys(buf, ":w\<CR>")
call term_wait(buf)
call TermWait(buf)
call WaitForAssert({-> assert_equal("WARNING: The file has been changed since reading it!!!", term_getline(buf, 9))})
call assert_equal("Do you really want to write to it (y/n)?",
\ term_getline(buf, 10))
call term_sendkeys(buf, "n\<CR>")
call term_wait(buf)
call TermWait(buf)
call assert_equal(new_ftime, getftime('Xfile'))
call term_sendkeys(buf, ":w\<CR>")
call term_wait(buf)
call TermWait(buf)
call term_sendkeys(buf, "y\<CR>")
call term_wait(buf)
call TermWait(buf)
call WaitForAssert({-> assert_equal('Line2', readfile('Xfile')[1])})
" clean up
@@ -671,7 +671,7 @@ func Test_readwrite_file_with_bom()
set cpoptions-=S
let &fileencoding = save_fileencoding
call delete('Xtest1')
call delete('Xtest2')
call delete('Xfile2')
call delete('Xtest3')
%bw!
endfunc