forked from aniani/vim
patch 8.2.0444: swap file test fails on some systems
Problem: Swap file test fails on some systems. Solution: Preserve the swap file. Send NL terminated keys.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
" Tests for the swap feature
|
" Tests for the swap feature
|
||||||
|
|
||||||
|
source check.vim
|
||||||
source shared.vim
|
source shared.vim
|
||||||
source term_util.vim
|
source term_util.vim
|
||||||
|
|
||||||
@@ -352,11 +353,12 @@ endfunc
|
|||||||
|
|
||||||
" Test for selecting 'q' in the attention prompt
|
" Test for selecting 'q' in the attention prompt
|
||||||
func Test_swap_prompt_splitwin()
|
func Test_swap_prompt_splitwin()
|
||||||
if !CanRunVimInTerminal()
|
CheckRunVimInTerminal
|
||||||
throw 'Skipped: cannot run vim in terminal'
|
|
||||||
endif
|
|
||||||
call writefile(['foo bar'], 'Xfile1')
|
call writefile(['foo bar'], 'Xfile1')
|
||||||
edit Xfile1
|
edit Xfile1
|
||||||
|
preserve " should help to make sure the swap file exists
|
||||||
|
|
||||||
let buf = RunVimInTerminal('', {'rows': 20})
|
let buf = RunVimInTerminal('', {'rows': 20})
|
||||||
call term_sendkeys(buf, ":set nomore\n")
|
call term_sendkeys(buf, ":set nomore\n")
|
||||||
call term_sendkeys(buf, ":set noruler\n")
|
call term_sendkeys(buf, ":set noruler\n")
|
||||||
@@ -365,9 +367,9 @@ func Test_swap_prompt_splitwin()
|
|||||||
call WaitForAssert({-> assert_match('^\[O\]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort: $', term_getline(buf, 20))})
|
call WaitForAssert({-> assert_match('^\[O\]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort: $', term_getline(buf, 20))})
|
||||||
call term_sendkeys(buf, "q")
|
call term_sendkeys(buf, "q")
|
||||||
call term_wait(buf)
|
call term_wait(buf)
|
||||||
call term_sendkeys(buf, ":")
|
call term_sendkeys(buf, ":\<CR>")
|
||||||
call WaitForAssert({-> assert_match('^:$', term_getline(buf, 20))})
|
call WaitForAssert({-> assert_match('^:$', term_getline(buf, 20))})
|
||||||
call term_sendkeys(buf, "echomsg winnr('$')\<CR>")
|
call term_sendkeys(buf, ":echomsg winnr('$')\<CR>")
|
||||||
call term_wait(buf)
|
call term_wait(buf)
|
||||||
call WaitForAssert({-> assert_match('^1$', term_getline(buf, 20))})
|
call WaitForAssert({-> assert_match('^1$', term_getline(buf, 20))})
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
|
@@ -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 */
|
||||||
|
/**/
|
||||||
|
444,
|
||||||
/**/
|
/**/
|
||||||
443,
|
443,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user