Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
patch 8.0.1594: :conform qall not tested with active terminal window
Problem:    :conform qall not tested with active terminal window.
Solution:   Add a test.
  • Loading branch information
brammool committed Mar 10, 2018
1 parent 25cdd9c commit 435acdb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/testdir/test_terminal.vim
Expand Up @@ -885,3 +885,26 @@ func Test_terminal_qall_kill_func()
" close the terminal window where Vim was running
quit
endfunc

" Run Vim in a terminal, then start a terminal in that Vim without a kill
" argument, check that :confirm qall works.
func Test_terminal_qall_prompt()
if !CanRunVimInTerminal()
return
endif
let buf = RunVimInTerminal('', {})

" Open a terminal window and wait for the prompt to appear
call term_sendkeys(buf, ":term\<CR>")
call WaitFor({-> term_getline(buf, 10) =~ '\[running]'})
call WaitFor({-> term_getline(buf, 1) !~ '^\s*$'})

" make Vim exit, it will prompt to kill the shell
call term_sendkeys(buf, "\<C-W>:confirm qall\<CR>")
call WaitFor({-> term_getline(buf, 20) =~ 'ancel:'})
call term_sendkeys(buf, "y")
call WaitFor({-> term_getstatus(buf) == "finished"})

" close the terminal window where Vim was running
quit
endfunc
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -766,6 +766,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1594,
/**/
1593,
/**/
Expand Down

0 comments on commit 435acdb

Please sign in to comment.