vim-patch:8.2.3440: recover test fails if there is an old swap file

Problem:    Recover test fails if there is an old swap file.
Solution:   Delete old swap files.

f2a8bafa4b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2022-11-17 23:02:47 +08:00
parent acfc3d54c6
commit d8fc390bd0

View File

@@ -175,6 +175,12 @@ func Test_recover_empty_swap_file()
call assert_match('Unable to read block 0 from .Xfile1.swp', msg) call assert_match('Unable to read block 0 from .Xfile1.swp', msg)
call assert_equal('Xfile1', @%) call assert_equal('Xfile1', @%)
bw! bw!
" make sure there are no old swap files laying around
for f in glob('.sw?', 0, 1)
call delete(f)
endfor
" :recover from an empty buffer " :recover from an empty buffer
call assert_fails('recover', 'E305:') call assert_fails('recover', 'E305:')
call delete('.Xfile1.swp') call delete('.Xfile1.swp')