summaryrefslogtreecommitdiffstats
path: root/src/testdir/runtest.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-12-05 20:58:04 +0000
committerBram Moolenaar <Bram@vim.org>2022-12-05 20:58:04 +0000
commitfa2533c8bb96abcec29b9dc6bd4fe7054c7c7e50 (patch)
treecd5923cd3c6685a9e620f6d2920f18b8d1e8858e /src/testdir/runtest.vim
parent99d19438cabaf13074229d9a32e3a4af9ce98744 (diff)
patch 9.0.1012: tests may get stuck in buffer with swap filev9.0.1012
Problem: Tests may get stuck in buffer with swap file. Solution: Bail out when bwipe! doesn't get another buffer.
Diffstat (limited to 'src/testdir/runtest.vim')
-rw-r--r--src/testdir/runtest.vim9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index 6c42616c5f..93acf99587 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -368,7 +368,14 @@ func RunTheTest(test)
" 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