mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.4564: running test leaves file behind
Problem: Running test leaves file behind. (Dominique Pellé) Solution: Run the profiling in a separate Vim instance. (closes #9952)
This commit is contained in:
parent
5c68617d39
commit
129e33e44b
@ -3882,27 +3882,6 @@ def Run_Test_debug_running_out_of_lines()
|
|||||||
delete('XdebugFunc')
|
delete('XdebugFunc')
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
def s:ProfiledWithLambda()
|
|
||||||
var n = 3
|
|
||||||
echo [[1, 2], [3, 4]]->filter((_, l) => l[0] == n)
|
|
||||||
enddef
|
|
||||||
|
|
||||||
def s:ProfiledNested()
|
|
||||||
var x = 0
|
|
||||||
def Nested(): any
|
|
||||||
return x
|
|
||||||
enddef
|
|
||||||
Nested()
|
|
||||||
enddef
|
|
||||||
|
|
||||||
def ProfiledNestedProfiled()
|
|
||||||
var x = 0
|
|
||||||
def Nested(): any
|
|
||||||
return x
|
|
||||||
enddef
|
|
||||||
Nested()
|
|
||||||
enddef
|
|
||||||
|
|
||||||
def Test_ambigous_command_error()
|
def Test_ambigous_command_error()
|
||||||
var lines =<< trim END
|
var lines =<< trim END
|
||||||
vim9script
|
vim9script
|
||||||
@ -3935,9 +3914,34 @@ enddef
|
|||||||
|
|
||||||
" Execute this near the end, profiling doesn't stop until Vim exits.
|
" Execute this near the end, profiling doesn't stop until Vim exits.
|
||||||
" This only tests that it works, not the profiling output.
|
" This only tests that it works, not the profiling output.
|
||||||
def Test_xx_profile_with_lambda()
|
def Test_profile_with_lambda()
|
||||||
CheckFeature profile
|
CheckFeature profile
|
||||||
|
|
||||||
|
var lines =<< trim END
|
||||||
|
vim9script
|
||||||
|
|
||||||
|
def ProfiledWithLambda()
|
||||||
|
var n = 3
|
||||||
|
echo [[1, 2], [3, 4]]->filter((_, l) => l[0] == n)
|
||||||
|
enddef
|
||||||
|
|
||||||
|
def ProfiledNested()
|
||||||
|
var x = 0
|
||||||
|
def Nested(): any
|
||||||
|
return x
|
||||||
|
enddef
|
||||||
|
Nested()
|
||||||
|
enddef
|
||||||
|
|
||||||
|
def g:ProfiledNestedProfiled()
|
||||||
|
var x = 0
|
||||||
|
def Nested(): any
|
||||||
|
return x
|
||||||
|
enddef
|
||||||
|
Nested()
|
||||||
|
enddef
|
||||||
|
|
||||||
|
def Profile()
|
||||||
profile start Xprofile.log
|
profile start Xprofile.log
|
||||||
profile func ProfiledWithLambda
|
profile func ProfiledWithLambda
|
||||||
ProfiledWithLambda()
|
ProfiledWithLambda()
|
||||||
@ -3953,6 +3957,22 @@ def Test_xx_profile_with_lambda()
|
|||||||
profdel func *
|
profdel func *
|
||||||
profile pause
|
profile pause
|
||||||
enddef
|
enddef
|
||||||
|
Profile()
|
||||||
|
writefile(['done'], 'Xdidprofile')
|
||||||
|
END
|
||||||
|
writefile(lines, 'Xprofile.vim')
|
||||||
|
call system(g:GetVimCommand()
|
||||||
|
.. ' --clean'
|
||||||
|
.. ' -c "so Xprofile.vim"'
|
||||||
|
.. ' -c "qall!"')
|
||||||
|
call assert_equal(0, v:shell_error)
|
||||||
|
|
||||||
|
assert_equal(['done'], readfile('Xdidprofile'))
|
||||||
|
assert_true(filereadable('Xprofile.log'))
|
||||||
|
delete('Xdidprofile')
|
||||||
|
delete('Xprofile.log')
|
||||||
|
delete('Xprofile.vim')
|
||||||
|
enddef
|
||||||
|
|
||||||
" Keep this last, it messes up highlighting.
|
" Keep this last, it messes up highlighting.
|
||||||
def Test_substitute_cmd()
|
def Test_substitute_cmd()
|
||||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
4564,
|
||||||
/**/
|
/**/
|
||||||
4563,
|
4563,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user