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)
|
local function test_ctrl_c(ms)
|
||||||
feed(":global/^/p<CR>")
|
feed(":global/^/p<CR>")
|
||||||
helpers.sleep(ms)
|
screen:sleep(ms)
|
||||||
feed("<C-C>")
|
feed("<C-C>")
|
||||||
screen:expect([[Interrupt]], nil, nil, nil, true)
|
screen:expect([[Interrupt]], nil, nil, nil, true)
|
||||||
end
|
end
|
||||||
|
@ -392,7 +392,16 @@ end
|
|||||||
|
|
||||||
-- sleeps the test runner (_not_ the nvim instance)
|
-- sleeps the test runner (_not_ the nvim instance)
|
||||||
local function sleep(ms)
|
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
|
end
|
||||||
|
|
||||||
local function curbuf_contents()
|
local function curbuf_contents()
|
||||||
|
@ -26,7 +26,7 @@ describe(':terminal', function()
|
|||||||
feed_command([[terminal while true; do echo X; done]])
|
feed_command([[terminal while true; do echo X; done]])
|
||||||
helpers.feed([[<C-\><C-N>]])
|
helpers.feed([[<C-\><C-N>]])
|
||||||
wait()
|
wait()
|
||||||
screen.sleep(10) -- Let some terminal activity happen.
|
screen:sleep(10) -- Let some terminal activity happen.
|
||||||
feed_command("messages")
|
feed_command("messages")
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
msg1 |
|
msg1 |
|
||||||
|
Loading…
Reference in New Issue
Block a user