Skip to content

Commit ce11de8

Browse files
committed
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.
1 parent 15993ce commit ce11de8

5 files changed

Lines changed: 19 additions & 3 deletions

File tree

src/testdir/runtest.vim

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,11 @@ func RunTheTest(test)
133133
endtry
134134
endif
135135

136-
" Close any extra windows and make the current one not modified.
136+
" Close any extra tab pages and windows and make the current one not modified.
137+
while tabpagenr('$') > 1
138+
bwipe!
139+
endwhile
140+
137141
while 1
138142
let wincount = winnr('$')
139143
if wincount == 1
@@ -146,7 +150,15 @@ func RunTheTest(test)
146150
break
147151
endif
148152
endwhile
153+
154+
" Wipe out all buffers except the current one, then wipe the current one.
155+
for nr in range(1, bufnr('$'))
156+
if nr != bufnr('%') && bufexists(nr)
157+
exe nr . 'bwipe!'
158+
endif
159+
endfor
149160
set nomodified
161+
bwipe
150162
endfunc
151163

152164
func AfterTheTest()

src/testdir/test_filetype.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ func Test_script_detection()
548548
for file in files
549549
call writefile(file, 'Xtest')
550550
split Xtest
551-
call assert_equal(ft, &filetype)
551+
call assert_equal(ft, &filetype, 'for text: ' . string(file))
552552
bwipe!
553553
endfor
554554
endfor

src/testdir/test_lispwords.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,5 @@ func Test_lisp_indent()
7878

7979
enew!
8080
let &cpoptions=save_copt
81+
set nolisp
8182
endfunc

src/testdir/test_tabpage.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ endfunc
475475

476476
func Test_close_on_quitpre()
477477
" This once caused a crash
478+
edit Xtest
478479
new
479480
only
480481
set bufhidden=delete
@@ -489,7 +490,7 @@ func Test_close_on_quitpre()
489490
while tabpagenr('$') > 1
490491
bwipe!
491492
endwhile
492-
1b
493+
buf Xtest
493494
endfunc
494495

495496
" vim: shiftwidth=2 sts=2 expandtab

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1222,
764766
/**/
765767
1221,
766768
/**/

0 commit comments

Comments
 (0)