1
0
forked from aniani/vim

patch 9.0.0626: too many delete() calls in tests

Problem:    Too many delete() calls in tests.
Solution:   Use deferred delete where possible.
This commit is contained in:
Bram Moolenaar
2022-09-29 21:37:33 +01:00
parent 7dd5a78b88
commit b152b6a40f
11 changed files with 52 additions and 96 deletions

View File

@@ -372,12 +372,11 @@ func Test_match_in_linebreak()
call printf('%s]%s', repeat('x', 50), repeat('x', 70))->setline(1)
call matchaddpos('ErrorMsg', [[1, 51]])
END
call writefile(lines, 'XscriptMatchLinebreak')
call writefile(lines, 'XscriptMatchLinebreak', 'D')
let buf = RunVimInTerminal('-S XscriptMatchLinebreak', #{rows: 10})
call VerifyScreenDump(buf, 'Test_match_linebreak', {})
call StopVimInTerminal(buf)
call delete('XscriptMatchLinebreak')
endfunc
func Test_match_with_incsearch()
@@ -388,7 +387,7 @@ func Test_match_with_incsearch()
call setline(1, range(20))
call matchaddpos('ErrorMsg', [3])
END
call writefile(lines, 'XmatchWithIncsearch')
call writefile(lines, 'XmatchWithIncsearch', 'D')
let buf = RunVimInTerminal('-S XmatchWithIncsearch', #{rows: 6})
call VerifyScreenDump(buf, 'Test_match_with_incsearch_1', {})
@@ -397,7 +396,6 @@ func Test_match_with_incsearch()
call term_sendkeys(buf, "\<CR>")
call StopVimInTerminal(buf)
call delete('XmatchWithIncsearch')
endfunc
" Test for deleting matches outside of the screen redraw top/bottom lines
@@ -428,12 +426,11 @@ func Test_match_tab_with_linebreak()
call setline(1, "\tix")
call matchadd('ErrorMsg', '\t')
END
call writefile(lines, 'XscriptMatchTabLinebreak')
call writefile(lines, 'XscriptMatchTabLinebreak', 'D')
let buf = RunVimInTerminal('-S XscriptMatchTabLinebreak', #{rows: 10})
call VerifyScreenDump(buf, 'Test_match_tab_linebreak', {})
call StopVimInTerminal(buf)
call delete('XscriptMatchTabLinebreak')
endfunc