patch 9.2.0070: tests: various tests leave swapfiles around

Problem:  tests: various tests leave swapfiles around
Solution: close open buffers using :bw! instead of :close!

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2026-02-27 18:57:47 +00:00
parent 9148644c1e
commit 2fa34b6422
4 changed files with 9 additions and 7 deletions
+4 -4
View File
@@ -109,7 +109,7 @@ func Test_Ex_emptybuf()
call setline(1, "abc")
call assert_fails('call feedkeys("Q\<CR>", "xt")', 'E501:')
call assert_fails('call feedkeys("Q%d\<CR>", "xt")', 'E749:')
close!
bw!
endfunc
" Test for the :open command
@@ -121,7 +121,7 @@ func Test_open_command()
call feedkeys("Qopen /bar/\<CR>", 'xt')
call assert_equal(5, col('.'))
call assert_fails('call feedkeys("Qopen /baz/\<CR>", "xt")', 'E479:')
close!
bw!
endfunc
func Test_open_command_flush_line()
@@ -237,12 +237,12 @@ func Test_Ex_append()
call setline(1, "\t abc")
call feedkeys("Qappend!\npqr\nxyz\n.\nvisual\n", 'xt')
call assert_equal(["\t abc", "\t pqr", "\t xyz"], getline(1, '$'))
close!
bw!
new
call feedkeys("Qappend\na\\\n.", 'xt')
call assert_equal(['a\'], getline(1, '$'))
close!
bw!
endfunc
func Test_ex_mode_errors()
+1 -1
View File
@@ -123,7 +123,7 @@ func Test_expandcmd()
endif
unlet $FOO
close!
bw!
endfunc
" Test for expanding <sfile>, <slnum> and <sflnum> outside of sourcing a script
+2 -2
View File
@@ -86,7 +86,7 @@ func Test_global_print()
endtry
call assert_equal('yes', caught)
close!
bw!
endfunc
func Test_global_empty_pattern()
@@ -110,7 +110,7 @@ func Test_global_newline()
call setline(1, ["foo\<NL>bar"])
exe "g/foo/s/foo\\\<NL>bar/xyz/"
call assert_equal('xyz', getline(1))
close!
bw!
endfunc
" Test :g with ? as delimiter.
+2
View File
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
70,
/**/
69,
/**/