mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
tests: detect invalid helpers.sleep
This commit is contained in:
parent
9cc9789681
commit
48f0542ad6
@ -41,7 +41,7 @@ describe("CTRL-C (mapped)", function()
|
||||
|
||||
local function test_ctrl_c(ms)
|
||||
feed(":global/^/p<CR>")
|
||||
helpers.sleep(ms)
|
||||
screen:sleep(ms)
|
||||
feed("<C-C>")
|
||||
screen:expect([[Interrupt]], nil, nil, nil, true)
|
||||
end
|
||||
|
@ -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()
|
||||
|
@ -26,7 +26,7 @@ describe(':terminal', function()
|
||||
feed_command([[terminal while true; do echo X; done]])
|
||||
helpers.feed([[<C-\><C-N>]])
|
||||
wait()
|
||||
screen.sleep(10) -- Let some terminal activity happen.
|
||||
screen:sleep(10) -- Let some terminal activity happen.
|
||||
feed_command("messages")
|
||||
screen:expect([[
|
||||
msg1 |
|
||||
|
Loading…
Reference in New Issue
Block a user