viml/reltime(): allow negative result #10453

- define proftime_T as signed integer
- profile_sub(): allow negative result

closes #10452
This commit is contained in:
Justin M. Keyes
2019-07-09 12:08:54 +02:00
committed by GitHub
parent 652be3cb00
commit 06af88cd72
4 changed files with 16 additions and 6 deletions

View File

@@ -33,4 +33,14 @@ describe('reltimestr(), reltimefloat()', function()
ok(reltimefloat(differs) < 1.0)
end)
it('reltime() allows negative result #10452', function()
local older_time = reltime()
command('sleep 1m')
local newer_time = reltime()
-- Should be something like -0.002123.
local rv = tonumber(reltimestr(reltime(newer_time, older_time)))
ok(rv < 0)
ok(rv > -10)
end)
end)