Mercurial > vim
comparison src/testdir/runtest.vim @ 31357:7fe2e5f8be42 v9.0.1012
patch 9.0.1012: tests may get stuck in buffer with swap file
Commit: https://github.com/vim/vim/commit/fa2533c8bb96abcec29b9dc6bd4fe7054c7c7e50
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Dec 5 20:58:04 2022 +0000
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 05 Dec 2022 22:00:04 +0100 |
parents | 49bd0e97549d |
children | 513d8dcc03a5 |
comparison
equal
deleted
inserted
replaced
31356:f39db32b3f7c | 31357:7fe2e5f8be42 |
---|---|
366 | 366 |
367 " May be editing some buffer, wipe it out. Then we may end up in another | 367 " May be editing some buffer, wipe it out. Then we may end up in another |
368 " buffer, continue until we end up in an empty no-name buffer without a swap | 368 " buffer, continue until we end up in an empty no-name buffer without a swap |
369 " file. | 369 " file. |
370 while bufname() != '' || execute('swapname') !~ 'No swap file' | 370 while bufname() != '' || execute('swapname') !~ 'No swap file' |
371 bwipe! | 371 let bn = bufnr() |
372 | |
373 noswapfile bwipe! | |
374 | |
375 if bn == bufnr() | |
376 " avoid getting stuck in the same buffer | |
377 break | |
378 endif | |
372 endwhile | 379 endwhile |
373 | 380 |
374 " Check if the test has left any swap files behind. Delete them before | 381 " Check if the test has left any swap files behind. Delete them before |
375 " running tests again, they might interfere. | 382 " running tests again, they might interfere. |
376 let swapfiles = s:GetSwapFileList() | 383 let swapfiles = s:GetSwapFileList() |