mirror of
https://github.com/vim/vim.git
synced 2025-10-05 05:34:07 -04:00
patch 8.2.0456: Test_confirm_cmd is flaky
Problem: Test_confirm_cmd is flaky. Solution: Add a term_wait() call. (closes #5854)
This commit is contained in:
@@ -242,6 +242,11 @@ func Test_confirm_cmd()
|
|||||||
call assert_equal(['foo4'], readfile('foo'))
|
call assert_equal(['foo4'], readfile('foo'))
|
||||||
call assert_equal(['bar2'], readfile('bar'))
|
call assert_equal(['bar2'], readfile('bar'))
|
||||||
|
|
||||||
|
call delete('foo')
|
||||||
|
call delete('bar')
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_confirm_cmd_cancel()
|
||||||
" Test for closing a window with a modified buffer
|
" Test for closing a window with a modified buffer
|
||||||
let buf = RunVimInTerminal('', {'rows': 20})
|
let buf = RunVimInTerminal('', {'rows': 20})
|
||||||
call term_sendkeys(buf, ":set nomore\n")
|
call term_sendkeys(buf, ":set nomore\n")
|
||||||
@@ -251,14 +256,12 @@ func Test_confirm_cmd()
|
|||||||
call WaitForAssert({-> assert_match('^\[Y\]es, (N)o, (C)ancel: *$',
|
call WaitForAssert({-> assert_match('^\[Y\]es, (N)o, (C)ancel: *$',
|
||||||
\ term_getline(buf, 20))}, 1000)
|
\ term_getline(buf, 20))}, 1000)
|
||||||
call term_sendkeys(buf, "C")
|
call term_sendkeys(buf, "C")
|
||||||
|
call term_wait(buf, 50)
|
||||||
call term_sendkeys(buf, ":confirm close\n")
|
call term_sendkeys(buf, ":confirm close\n")
|
||||||
call WaitForAssert({-> assert_match('^\[Y\]es, (N)o, (C)ancel: *$',
|
call WaitForAssert({-> assert_match('^\[Y\]es, (N)o, (C)ancel: *$',
|
||||||
\ term_getline(buf, 20))}, 1000)
|
\ term_getline(buf, 20))}, 1000)
|
||||||
call term_sendkeys(buf, "N")
|
call term_sendkeys(buf, "N")
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
|
|
||||||
call delete('foo')
|
|
||||||
call delete('bar')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for the :print command
|
" Test for the :print command
|
||||||
|
@@ -738,6 +738,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 */
|
||||||
|
/**/
|
||||||
|
456,
|
||||||
/**/
|
/**/
|
||||||
455,
|
455,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user