aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/ui_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-13 08:16:06 +0800
committerGitHub <noreply@github.com>2022-11-13 08:16:06 +0800
commite7ba5ba3cd8e426d07a8359a3d85a62b095faf61 (patch)
tree629239e111f50ba64ef93e86161959346ca25108 /test/functional/lua/ui_spec.lua
parentf516a9ced7238dbb9a3eff453736702fc3d9ec82 (diff)
downloadrneovim-e7ba5ba3cd8e426d07a8359a3d85a62b095faf61.tar.gz
rneovim-e7ba5ba3cd8e426d07a8359a3d85a62b095faf61.tar.bz2
rneovim-e7ba5ba3cd8e426d07a8359a3d85a62b095faf61.zip
test(lua/ui_spec): fix Ctrl-C test flakiness (#21039)
Prevent Ctrl-C from flushing the command that starts the prompt.
Diffstat (limited to 'test/functional/lua/ui_spec.lua')
-rw-r--r--test/functional/lua/ui_spec.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/functional/lua/ui_spec.lua b/test/functional/lua/ui_spec.lua
index c34d947b8b..9ee99b4905 100644
--- a/test/functional/lua/ui_spec.lua
+++ b/test/functional/lua/ui_spec.lua
@@ -4,6 +4,7 @@ local exec_lua = helpers.exec_lua
local clear = helpers.clear
local feed = helpers.feed
local eval = helpers.eval
+local poke_eventloop = helpers.poke_eventloop
describe('vim.ui', function()
before_each(function()
@@ -114,6 +115,7 @@ describe('vim.ui', function()
it('can return nil when interrupted with Ctrl-C #18144', function()
feed(':lua result = "on_confirm not called"<cr>')
feed(':lua vim.ui.input({}, function(input) result = input end)<cr>')
+ poke_eventloop() -- This is needed because Ctrl-C flushes input
feed('Inputted Text<c-c>')
eq(true, exec_lua('return (nil == result)'))
end)