changeset 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 f39db32b3f7c
children 624dec72c562
files src/testdir/runtest.vim src/version.c
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1012,
+/**/
     1011,
 /**/
     1010,