aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-19 11:09:34 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-04-19 11:29:35 +0800
commitab7bd119d7788cbf6735f4ca439246f07aa73911 (patch)
treecf71486f210af9b8300bc5db10eed7c1269782bd
parenta2f4bad781efd6c011dc93845fce342b6477162d (diff)
downloadrneovim-ab7bd119d7788cbf6735f4ca439246f07aa73911.tar.gz
rneovim-ab7bd119d7788cbf6735f4ca439246f07aa73911.tar.bz2
rneovim-ab7bd119d7788cbf6735f4ca439246f07aa73911.zip
vim-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. https://github.com/vim/vim/commit/fa2533c8bb96abcec29b9dc6bd4fe7054c7c7e50 Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r--test/old/testdir/runtest.vim9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/old/testdir/runtest.vim b/test/old/testdir/runtest.vim
index 5fda5bb440..935d033e4e 100644
--- a/test/old/testdir/runtest.vim
+++ b/test/old/testdir/runtest.vim
@@ -323,7 +323,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