patch 9.0.1005: a failed test may leave a swap file behind
Problem: A failed test may leave a swap file behind.
Solution: Delete the swap file to avoid another test to fail. Use another
file name.
diff --git a/src/testdir/test_suspend.vim b/src/testdir/test_suspend.vim
index 1c6ebbc..ebefdd0 100644
--- a/src/testdir/test_suspend.vim
+++ b/src/testdir/test_suspend.vim
@@ -24,6 +24,9 @@
call WaitForResponses()
+ " in case a previous failure left a swap file behind
+ call delete('.Xfoo.swp')
+
let buf = term_start('/bin/sh')
" Wait for shell prompt.
call WaitForAssert({-> assert_match('[$#] $', term_getline(buf, '.'))})
@@ -62,6 +65,7 @@
exe buf . 'bwipe!'
call delete('Xfoo')
+ call delete('.Xfoo.swp')
endfunc
func Test_suspend_autocmd()
@@ -70,6 +74,9 @@
call WaitForResponses()
+ " in case a previous failure left a swap file behind
+ call delete('.Xfoo.swp')
+
let buf = term_start('/bin/sh', #{term_rows: 6})
" Wait for shell prompt.
call WaitForAssert({-> assert_match('[$#] $', term_getline(buf, '.'))})
@@ -108,6 +115,7 @@
exe buf . 'bwipe!'
call delete('Xfoo')
+ call delete('.Xfoo.swp')
endfunc
" vim: shiftwidth=2 sts=2 expandtab