]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1012: tests may get stuck in buffer with swap file v9.0.1012
authorBram Moolenaar <Bram@vim.org>
Mon, 5 Dec 2022 20:58:04 +0000 (20:58 +0000)
committerBram Moolenaar <Bram@vim.org>
Mon, 5 Dec 2022 20:58:04 +0000 (20:58 +0000)
Problem:    Tests may get stuck in buffer with swap file.
Solution:   Bail out when bwipe! doesn't get another buffer.

src/testdir/runtest.vim
src/version.c

index 6c42616c5ff9ee687eb623cdde8909c054bba38d..93acf9958773b52c69b1fd00add2ac502dff6c32 100644 (file)
@@ -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
index 48bec3d9a99d0aa9bf70bbaf68cb7a71925c3120..99f8b66f166bfafb967f90e65717e3263537aa3d 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1012,
 /**/
     1011,
 /**/