Mercurial > vim
comparison src/testdir/runtest.vim @ 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 | 47f253caa805 |
children | 03a6aeea2096 |
comparison
equal
deleted
inserted
replaced
12687:cd09b5cfc0b3 | 12688:a6a935b3270e |
---|---|
131 catch | 131 catch |
132 call add(v:errors, 'Caught exception in TearDown() after ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint) | 132 call add(v:errors, 'Caught exception in TearDown() after ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint) |
133 endtry | 133 endtry |
134 endif | 134 endif |
135 | 135 |
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 | |
137 while 1 | 141 while 1 |
138 let wincount = winnr('$') | 142 let wincount = winnr('$') |
139 if wincount == 1 | 143 if wincount == 1 |
140 break | 144 break |
141 endif | 145 endif |
144 " Did not manage to close a window. | 148 " Did not manage to close a window. |
145 only! | 149 only! |
146 break | 150 break |
147 endif | 151 endif |
148 endwhile | 152 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 | |
149 set nomodified | 160 set nomodified |
161 bwipe | |
150 endfunc | 162 endfunc |
151 | 163 |
152 func AfterTheTest() | 164 func AfterTheTest() |
153 if len(v:errors) > 0 | 165 if len(v:errors) > 0 |
154 let s:fail += 1 | 166 let s:fail += 1 |