aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-02-05 16:47:51 +0100
committerGitHub <noreply@github.com>2022-02-05 16:47:51 +0100
commitcee944e3ee548621776fde7ecd1bf65ae0609a06 (patch)
tree214161bc545f16c694b252271ebaf6911777ee5b /test/functional/api
parentf68d25737fffed76f320ee3100dac9fb396f30f8 (diff)
parent5b34c2ab73d62431f391d454e68a84332148d609 (diff)
downloadrneovim-cee944e3ee548621776fde7ecd1bf65ae0609a06.tar.gz
rneovim-cee944e3ee548621776fde7ecd1bf65ae0609a06.tar.bz2
rneovim-cee944e3ee548621776fde7ecd1bf65ae0609a06.zip
Merge pull request #17199 from glacambre/fix_9358
fix(--headless): do not block on press-enter prompts when no UI
Diffstat (limited to 'test/functional/api')
-rw-r--r--test/functional/api/vim_spec.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index b5b10c049e..937b6559de 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -333,6 +333,7 @@ describe('API', function()
describe('nvim_command_output', function()
it('does not induce hit-enter prompt', function()
+ nvim("ui_attach", 80, 20, {})
-- Induce a hit-enter prompt use nvim_input (non-blocking).
nvim('command', 'set cmdheight=1')
nvim('input', [[:echo "hi\nhi2"<CR>]])
@@ -1093,7 +1094,20 @@ describe('API', function()
eq({mode='n', blocking=false}, nvim("get_mode"))
end)
+ it("during press-enter prompt without UI returns blocking=false", function()
+ eq({mode='n', blocking=false}, nvim("get_mode"))
+ command("echom 'msg1'")
+ command("echom 'msg2'")
+ command("echom 'msg3'")
+ command("echom 'msg4'")
+ command("echom 'msg5'")
+ eq({mode='n', blocking=false}, nvim("get_mode"))
+ nvim("input", ":messages<CR>")
+ eq({mode='n', blocking=false}, nvim("get_mode"))
+ end)
+
it("during press-enter prompt returns blocking=true", function()
+ nvim("ui_attach", 80, 20, {})
eq({mode='n', blocking=false}, nvim("get_mode"))
command("echom 'msg1'")
command("echom 'msg2'")
@@ -1117,6 +1131,7 @@ describe('API', function()
-- TODO: bug #6247#issuecomment-286403810
it("batched with input", function()
+ nvim("ui_attach", 80, 20, {})
eq({mode='n', blocking=false}, nvim("get_mode"))
command("echom 'msg1'")
command("echom 'msg2'")