vim-patch:8.2.1033: not easy to read the test time in the test output

Problem:    Not easy to read the test time in the test output.
Solution:   Align the times.  Make slow tests bold.
8d9437968b
This commit is contained in:
Jan Edmund Lazo 2020-08-28 20:57:20 -04:00
parent 269a271a10
commit 61218d3c77
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15

View File

@ -209,7 +209,15 @@ func RunTheTest(test)
let message = 'Executed ' . a:test
if has('reltime')
let message ..= ' in ' .. reltimestr(reltime(func_start)) .. ' seconds'
let message ..= repeat(' ', 50 - len(message))
let time = reltime(func_start)
if has('float') && reltimefloat(time) > 0.1
let message = &t_md .. message
endif
let message ..= ' in ' .. reltimestr(time) .. ' seconds'
if has('float') && reltimefloat(time) > 0.1
let message ..= &t_me
endif
endif
call add(s:messages, message)
let s:done += 1
@ -277,7 +285,9 @@ func FinishTesting()
let message = 'Executed ' . s:done . (s:done > 1 ? ' tests' : ' test')
endif
if s:done > 0 && has('reltime')
let message = &t_md .. message .. repeat(' ', 40 - len(message))
let message ..= ' in ' .. reltimestr(reltime(s:start_time)) .. ' seconds'
let message ..= &t_me
endif
echo message
call add(s:messages, message)