patch 9.0.1012: tests may get stuck in buffer with swap file
Problem: Tests may get stuck in buffer with swap file.
Solution: Bail out when bwipe! doesn't get another buffer.
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index 6c42616..93acf99 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -368,7 +368,14 @@
" buffer, continue until we end up in an empty no-name buffer without a swap
" file.
while bufname() != '' || execute('swapname') !~ 'No swap file'
- bwipe!
+ let bn = bufnr()
+
+ noswapfile bwipe!
+
+ if bn == bufnr()
+ " avoid getting stuck in the same buffer
+ break
+ endif
endwhile
" Check if the test has left any swap files behind. Delete them before