changeset 12688:a6a935b3270e v8.0.1222

patch 8.0.1222: test functions interfere with each other commit https://github.com/vim/vim/commit/ce11de87e26e1420703242f8e07b4fd69c4032ba Author: Bram Moolenaar <Bram@vim.org> Date: Thu Oct 26 22:00:00 2017 +0200 patch 8.0.1222: test functions interfere with each other Problem: Test functions interfere with each other. Solution: Cleanup tab pages, windows and buffers. Reset option.
author Christian Brabandt <cb@256bit.org>
date Thu, 26 Oct 2017 22:15:04 +0200
parents cd09b5cfc0b3
children c41803f2a616
files src/testdir/runtest.vim src/testdir/test_filetype.vim src/testdir/test_lispwords.vim src/testdir/test_tabpage.vim src/version.c
diffstat 5 files changed, 19 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -133,7 +133,11 @@ func RunTheTest(test)
     endtry
   endif
 
-  " Close any extra windows and make the current one not modified.
+  " Close any extra tab pages and windows and make the current one not modified.
+  while tabpagenr('$') > 1
+    bwipe!
+  endwhile
+
   while 1
     let wincount = winnr('$')
     if wincount == 1
@@ -146,7 +150,15 @@ func RunTheTest(test)
       break
     endif
   endwhile
+
+  " Wipe out all buffers except the current one, then wipe the current one.
+  for nr in range(1, bufnr('$'))
+    if nr != bufnr('%') && bufexists(nr)
+      exe nr . 'bwipe!'
+    endif
+  endfor
   set nomodified
+  bwipe
 endfunc
 
 func AfterTheTest()
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -548,7 +548,7 @@ func Test_script_detection()
     for file in files
       call writefile(file, 'Xtest')
       split Xtest
-      call assert_equal(ft, &filetype)
+      call assert_equal(ft, &filetype, 'for text: ' . string(file))
       bwipe!
     endfor
   endfor
--- a/src/testdir/test_lispwords.vim
+++ b/src/testdir/test_lispwords.vim
@@ -78,4 +78,5 @@ func Test_lisp_indent()
 
   enew!
   let &cpoptions=save_copt
+  set nolisp
 endfunc
--- a/src/testdir/test_tabpage.vim
+++ b/src/testdir/test_tabpage.vim
@@ -475,6 +475,7 @@ endfunc
 
 func Test_close_on_quitpre()
   " This once caused a crash
+  edit Xtest
   new
   only
   set bufhidden=delete
@@ -489,7 +490,7 @@ func Test_close_on_quitpre()
   while tabpagenr('$') > 1
     bwipe!
   endwhile
-  1b
+  buf Xtest
 endfunc
 
 " vim: shiftwidth=2 sts=2 expandtab
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1222,
+/**/
     1221,
 /**/
     1220,