diff src/testdir/test_popupwin.vim @ 19275:2142fb624658 v8.2.0196

patch 8.2.0196: blocking commands for a finished job in a popup window Commit: https://github.com/vim/vim/commit/d98c0b63abd7b0e61a383669474abe96044615af Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 2 15:25:16 2020 +0100 patch 8.2.0196: blocking commands for a finished job in a popup window Problem: Blocking commands for a finished job in a popup window. Solution: Do not block commands if the job has finished. Adjust test.
author Bram Moolenaar <Bram@vim.org>
date Sun, 02 Feb 2020 15:30:04 +0100
parents c53dbbf3229b
children 1d6bc6b31c2e
line wrap: on
line diff
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -2396,10 +2396,20 @@ endfunc
 
 func Test_popupwin_terminal_buffer()
   CheckFeature terminal
-
+  CheckUnix
+
+  let origwin = win_getid()
   let ptybuf = term_start(&shell, #{hidden: 1})
-  call assert_fails('let winnr = popup_create(ptybuf, #{})', 'E278:')
-  exe 'bwipe! ' .. ptybuf
+  let winnr = popup_create(ptybuf, #{minwidth: 40, minheight: 10})
+  " Wait for shell to start
+  sleep 200m
+  " Cannot quit while job is running
+  call assert_fails('call feedkeys("\<C-W>:quit\<CR>", "xt")', 'E948:')
+  call feedkeys("exit\<CR>", 'xt')
+  " Wait for shell to exit
+  sleep 100m
+  call feedkeys(":quit\<CR>", 'xt')
+  call assert_equal(origwin, win_getid())
 endfunc
 
 func Test_popupwin_with_buffer_and_filter()