]> granicus.if.org Git - vim/commitdiff
patch 8.2.1938: wiping out a terminal buffer makes some tests fail v8.2.1938
authorBram Moolenaar <Bram@vim.org>
Sun, 1 Nov 2020 19:58:26 +0000 (20:58 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 1 Nov 2020 19:58:26 +0000 (20:58 +0100)
Problem:    Wiping out a terminal buffer makes some tests fail.
Solution:   Do not wipe out the terminal buffer unless wanted.

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

index c2a2c350cd3f821a3914444fd0905ea81c0d30b2..cfc850ba00a9c189ca128d065a7009ed4f57c66b 100644 (file)
@@ -134,7 +134,7 @@ func RunVimInTerminal(arguments, options)
 endfunc
 
 " Stop a Vim running in terminal buffer "buf".
-func StopVimInTerminal(buf)
+func StopVimInTerminal(buf, kill = 1)
   " Using a terminal to run Vim is always considered flaky.
   let g:test_is_flaky = 1
 
@@ -151,7 +151,7 @@ func StopVimInTerminal(buf)
   call WaitForAssert({-> assert_equal("finished", term_getstatus(a:buf))})
 
   " If the buffer still exists forcefully wipe it.
-  if bufexists(a:buf)
+  if a:kill && bufexists(a:buf)
     exe a:buf .. 'bwipe!'
   endif
 endfunc
index 829706c93be50a74fa8d0914133c494efa98154d..f5b99bcc885a56e766ddf03443b8e4f1a36cecfb 100644 (file)
@@ -1230,7 +1230,7 @@ func Test_terminal_dumpwrite_errors()
   call assert_fails("call term_dumpwrite(buf, '')", 'E482:')
   call assert_fails("call term_dumpwrite(buf, test_null_string())", 'E482:')
   call test_garbagecollect_now()
-  call StopVimInTerminal(buf)
+  call StopVimInTerminal(buf, 0)
   call TermWait(buf)
   call assert_fails("call term_dumpwrite(buf, 'Xtest.dump')", 'E958:')
   call assert_fails('call term_sendkeys([], ":q\<CR>")', 'E745:')
index a3b8c1c2b7145cc84c5419cdd9f7a8440ae02db1..db6ebc00fb15afdc29935f142b44793a510e75f8 100644 (file)
@@ -560,7 +560,6 @@ func Test_terminal_getwinpos()
   call TermWait(buf)
   call term_sendkeys(buf, ":q\<CR>")
   call StopVimInTerminal(buf)
-  exe buf . 'bwipe!'
   set splitright&
   only!
 endfunc
index 65050b9a31310ba8b420de81248ab7ca898064a7..3cba21401f26d47e0419495724a020b8e51b0e37 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1938,
 /**/
     1937,
 /**/