diff src/testdir/test_terminal.vim @ 20384:42ab4d40e78f v8.2.0747

patch 8.2.0747: cannot forcefully close all popups Commit: https://github.com/vim/vim/commit/03a9f848175b182372fb33403998059724a8bf31 Author: Bram Moolenaar <Bram@vim.org> Date: Wed May 13 13:40:16 2020 +0200 patch 8.2.0747: cannot forcefully close all popups Problem: Cannot forcefully close all popups. Solution: Add the "force" argument to popup_clear(). Use it after running a test. Put back the check for a popup when editing a file.
author Bram Moolenaar <Bram@vim.org>
date Wed, 13 May 2020 13:45:04 +0200
parents 6bcd12791bf1
children 9f34aae7f69d
line wrap: on
line diff
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -2617,27 +2617,15 @@ endfunc
 
 func Test_term_nasty_callback()
   CheckExecutable sh
-  func OpenTerms()
-    set hidden
-    let g:buf0 = term_start('sh', #{hidden: 1})
-    call popup_create(g:buf0, {})
-    let g:buf1 = term_start('sh', #{hidden: 1, term_finish: 'close'})
-    call popup_create(g:buf1, {})
-    let g:buf2 = term_start(['sh', '-c'], #{curwin: 1, exit_cb: function('TermExit')})
-    call TermWait(g:buf2, 50)
-    call popup_close(win_getid())
-  endfunc
-  func TermExit(...)
-    let altbuf = bufnr('#')
-    call term_sendkeys(altbuf, "exit\<CR>")
-    call TermWait(altbuf)
-    call popup_close(win_getid())
-  endfunc
-  call OpenTerms()
-
-  call term_sendkeys(g:buf0, "exit\<CR>")
-  call TermWait(g:buf0, 50)
-  exe g:buf0 .. 'bwipe!'
+
+  set hidden
+  let g:buf0 = term_start('sh', #{hidden: 1})
+  call popup_create(g:buf0, {})
+  let g:buf1 = term_start('sh', #{hidden: 1, term_finish: 'close'})
+  call popup_create(g:buf1, {})
+  call assert_fails("call term_start(['sh', '-c'], #{curwin: 1})", 'E863:')
+
+  call popup_clear(1)
   set hidden&
 endfunc