summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_window_cmd.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-12-04 23:00:41 +0000
committerBram Moolenaar <Bram@vim.org>2022-12-04 23:00:41 +0000
commitd0f8d39d20f8d42f7451f781f7be0bcd20e06741 (patch)
tree12356592535e2b49d036caaa37f643eaf8c21fa5 /src/testdir/test_window_cmd.vim
parenta0a6f3a22a934fa68b71d82c23e2f6bf6e5b18d0 (diff)
patch 9.0.1005: a failed test may leave a swap file behindv9.0.1005
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.
Diffstat (limited to 'src/testdir/test_window_cmd.vim')
-rw-r--r--src/testdir/test_window_cmd.vim4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim
index 3519a1dce3..9a042c3ca8 100644
--- a/src/testdir/test_window_cmd.vim
+++ b/src/testdir/test_window_cmd.vim
@@ -137,6 +137,8 @@ endfunc
" Test the ":wincmd ^" and "<C-W>^" commands.
func Test_window_split_edit_alternate()
+ " in case a previous failure left a swap file behind
+ call delete('.Xfoo.swp')
" Test for failure when the alternate buffer/file no longer exists.
edit Xfoo | %bw
@@ -170,6 +172,8 @@ endfunc
" Test the ":[count]wincmd ^" and "[count]<C-W>^" commands.
func Test_window_split_edit_bufnr()
+ " in case a previous failure left a swap file behind
+ call delete('.Xfoo.swp')
%bwipeout
let l:nr = bufnr('%') + 1