]> granicus.if.org Git - vim/commitdiff
patch 8.0.1594: :conform qall not tested with active terminal window v8.0.1594
authorBram Moolenaar <Bram@vim.org>
Sat, 10 Mar 2018 19:51:25 +0000 (20:51 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 10 Mar 2018 19:51:25 +0000 (20:51 +0100)
Problem:    :conform qall not tested with active terminal window.
Solution:   Add a test.

src/testdir/test_terminal.vim
src/version.c

index ef6b176eec8f95a7ba44c42e350deea332f8fcdf..0178e3b8886e0cf34da91eedf41cf5f0a2647429 100644 (file)
@@ -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
index 727c21fe1c66d960186ffc6341f4dbf24a4a970a..a6c7279c031d61ca81a66ca9d09ac5ecccb6356a 100644 (file)
@@ -766,6 +766,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1594,
 /**/
     1593,
 /**/