vim-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!

2fa34b6422

Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2026-02-28 07:04:53 +08:00
parent 6ce964aed6
commit cd4c7850d0
2 changed files with 5 additions and 5 deletions

View File

@@ -113,7 +113,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
@@ -126,7 +126,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()
@@ -246,12 +246,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()

View File

@@ -69,7 +69,7 @@ func Test_global_print()
v/foo\|bar/p
call assert_notequal('', v:statusmsg)
close!
bw!
endfunc
func Test_global_empty_pattern()