patch 9.0.1874: CI may fail in test_recover_empty_swap

Commit: 
https://github.com/vim/vim/commit/1c7397f3f1e168541f88bb1bbd93a9f0b1235852
Author: Christian Brabandt <[email protected]>
Date:   Tue Sep 5 20:40:25 2023 +0200

    patch 9.0.1874: CI may fail in test_recover_empty_swap
    
    Problem:  CI may fail in test_recover_empty_swap
    Solution: Set directory option
    
    Fix failing Test_recover_empty_swap test
    
    :recover by default not only looks in the current directory, but also in
    ~/tmp for files to recover. If it finds some files to recover, it will
    interactively prompt for a file to recover. However, prompting doesn't
    work when running the test suite (and even if it would, there is no one
    that can answer the prompt).
    
    So it doesn't really make sense during testing, to inspect different
    directories for swap files and prompt and wait (which will lead to a
    timeout and therefore a failing test).
    
    So set the 'directory' option temporarily to the current directory only
    and reset it back once the test finishes.
    
    closes: #13038
    
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/testdir/test_recover.vim b/src/testdir/test_recover.vim
index 8af139736..a084ef463 100644
--- a/src/testdir/test_recover.vim
+++ b/src/testdir/test_recover.vim
@@ -161,6 +161,7 @@ endfunc
 func Test_recover_empty_swap_file()
   CheckUnix
   call writefile([], '.Xfile1.swp', 'D')
+  set dir=.
   let msg = execute('recover Xfile1')
   call assert_match('Unable to read block 0 from .Xfile1.swp', msg)
   call assert_equal('Xfile1', @%)
@@ -173,6 +174,7 @@ func Test_recover_empty_swap_file()
 
   " :recover from an empty buffer
   call assert_fails('recover', 'E305:')
+  set dir&vim
 endfunc
 
 " Test for :recover using a corrupted swap file
diff --git a/src/version.c b/src/version.c
index 2faa9e668..061e18b4c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1874,
 /**/
     1873,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1qdb2t-00GnhA-BE%40256bit.org.

Raspunde prin e-mail lui