vim-patch:8.1.1516: time reported for a test measured wrong

Problem:    Time reported for a test measured wrong.
Solution:   Move the computation to the end of RunTheTest(). (Ozaki Kiichi,
            closes vim/vim#4520)
640d4f0c97
This commit is contained in:
Jan Edmund Lazo
2020-08-23 13:22:07 -04:00
parent 8c49e3d509
commit 3fac3cad75

View File

@@ -136,13 +136,6 @@ func RunTheTest(test)
endtry endtry
endif endif
let message = 'Executed ' . a:test
if has('reltime')
let message ..= ' in ' .. reltimestr(reltime(func_start)) .. ' seconds'
endif
call add(s:messages, message)
let s:done += 1
if a:test =~ 'Test_nocatch_' if a:test =~ 'Test_nocatch_'
" Function handles errors itself. This avoids skipping commands after the " Function handles errors itself. This avoids skipping commands after the
" error. " error.
@@ -196,6 +189,13 @@ func RunTheTest(test)
endwhile endwhile
exe 'cd ' . save_cwd exe 'cd ' . save_cwd
let message = 'Executed ' . a:test
if has('reltime')
let message ..= ' in ' .. reltimestr(reltime(func_start)) .. ' seconds'
endif
call add(s:messages, message)
let s:done += 1
endfunc endfunc
func AfterTheTest() func AfterTheTest()