]> granicus.if.org Git - vim/commitdiff
patch 8.0.1222: test functions interfere with each other v8.0.1222
authorBram Moolenaar <Bram@vim.org>
Thu, 26 Oct 2017 20:00:00 +0000 (22:00 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 26 Oct 2017 20:00:00 +0000 (22:00 +0200)
Problem:    Test functions interfere with each other.
Solution:   Cleanup tab pages, windows and buffers.  Reset option.

src/testdir/runtest.vim
src/testdir/test_filetype.vim
src/testdir/test_lispwords.vim
src/testdir/test_tabpage.vim
src/version.c

index ae45a3eb4e805a6417c0f96302f1439d7f7a2385..d1593825a4d9f6b4b366e7a145e7bd9753627d43 100644 (file)
@@ -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()
index 061c3795adb9a623c3cb3e30b086b32a34fdc8c2..1a427f641297b212f57252e981d5ca02dc767c46 100644 (file)
@@ -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
index c7eda83540334102d58ff0eb312d16dbd9a913e3..4c05504cf17a3080db2796290b2a6d87a1952362 100644 (file)
@@ -78,4 +78,5 @@ func Test_lisp_indent()
 
   enew!
   let &cpoptions=save_copt
+  set nolisp
 endfunc
index 239b1b965bf3af38a43853ef1df7ef050a980661..95e3c135f2ea91b80f6284c06ac983345f950c15 100644 (file)
@@ -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
index 88d8995d5b188e79818290f42561bb87cff334d3..1cb437b21f1147b0f65cd85ced648b97f6e5d856 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1222,
 /**/
     1221,
 /**/