tests: detect invalid helpers.sleep

This commit is contained in:
Björn Linse
2017-04-21 10:59:06 +02:00
parent 9cc9789681
commit 48f0542ad6
3 changed files with 12 additions and 3 deletions

View File

@@ -392,7 +392,16 @@ end
-- sleeps the test runner (_not_ the nvim instance)
local function sleep(ms)
run(nil, nil, nil, ms)
local function notification_cb(method, args)
local _ = args
if method == "redraw" then
error("helpers.sleep() called while screen is attached. "..
"Use screen:sleep(...) instead")
end
return true
end
run(nil, notification_cb, nil, ms)
end
local function curbuf_contents()