]> granicus.if.org Git - vim/commitdiff
patch 9.0.1010: stray warnings for existing swap files v9.0.1010
authorBram Moolenaar <Bram@vim.org>
Mon, 5 Dec 2022 15:50:41 +0000 (15:50 +0000)
committerBram Moolenaar <Bram@vim.org>
Mon, 5 Dec 2022 15:50:41 +0000 (15:50 +0000)
Problem:    Stray warnings for existing swap files.
Solution:   Wipe out the buffer until it has no name and no swap file.

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

index 2eabb1a9cb0a351b90e525a1407f5c6c58871956..6c42616c5ff9ee687eb623cdde8909c054bba38d 100644 (file)
@@ -364,6 +364,13 @@ func RunTheTest(test)
   call add(s:messages, message)
   let s:done += 1
 
+  " May be editing some buffer, wipe it out.  Then we may end up in another
+  " buffer, continue until we end up in an empty no-name buffer without a swap
+  " file.
+  while bufname() != '' || execute('swapname') !~ 'No swap file'
+    bwipe!
+  endwhile
+
   " Check if the test has left any swap files behind.  Delete them before
   " running tests again, they might interfere.
   let swapfiles = s:GetSwapFileList()
index 593e56819c7a0a8547686571e78bbd924d908655..2df70b4df7393b4b13ea72179e191d6293583719 100644 (file)
@@ -578,6 +578,8 @@ func Test_WinScrolled_long_wrapped()
   call term_sendkeys(buf, '$')
   call term_sendkeys(buf, ":echo g:scrolled\<CR>")
   call WaitForAssert({-> assert_match('^3 ', term_getline(buf, 6))}, 1000)
+
+  call StopVimInTerminal(buf)
 endfunc
 
 func Test_WinClosed()
@@ -3162,7 +3164,7 @@ func Test_autocmd_FileReadCmd()
         \ 'v:cmdarg =  ++ff=mac',
         \ 'v:cmdarg =  ++enc=utf-8'], getline(1, '$'))
 
-  close!
+  bwipe!
   augroup FileReadCmdTest
     au!
   augroup END
index b2f1babba8479369190646ddd3343981f1dc23ea..b8b346071abb624b72ab266c23f6a4fb3254637a 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1010,
 /**/
     1009,
 /**/