aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core/job_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/core/job_spec.lua')
-rw-r--r--test/functional/core/job_spec.lua41
1 files changed, 38 insertions, 3 deletions
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua
index 1bae626b98..038368c387 100644
--- a/test/functional/core/job_spec.lua
+++ b/test/functional/core/job_spec.lua
@@ -88,7 +88,6 @@ describe('jobs', function()
end)
it('append environment with pty #env', function()
- skip(is_os('win'))
nvim('command', "let $VAR = 'abc'")
nvim('command', "let $TOTO = 'goodbye world'")
nvim('command', "let g:job_opts.pty = v:true")
@@ -701,7 +700,7 @@ describe('jobs', function()
os.remove('Xtest_jobstart_env')
end)
- describe('jobwait', function()
+ describe('jobwait()', function()
before_each(function()
if is_os('win') then
helpers.set_shell_powershell()
@@ -806,7 +805,6 @@ describe('jobs', function()
end)
it('can be called recursively', function()
- skip(is_os('win'), "TODO: Need `cat`")
source([[
let g:opts = {}
let g:counter = 0
@@ -876,6 +874,43 @@ describe('jobs', function()
eq({'notification', 'wait', {{-1, -1}}}, next_msg())
end)
end)
+
+ it('hides cursor and flushes messages before blocking', function()
+ local screen = Screen.new(50, 6)
+ screen:set_default_attr_ids({
+ [0] = {foreground = Screen.colors.Blue, bold = true}; -- NonText
+ [1] = {bold = true, reverse = true}; -- MsgSeparator
+ [2] = {bold = true, foreground = Screen.colors.SeaGreen}; -- MoreMsg
+ })
+ screen:attach()
+ command([[let g:id = jobstart([v:progpath, '--clean', '--headless'])]])
+ source([[
+ func PrintAndWait()
+ echon "aaa\nbbb"
+ call jobwait([g:id], 300)
+ echon "\nccc"
+ endfunc
+ ]])
+ feed_command('call PrintAndWait()')
+ screen:expect{grid=[[
+ |
+ {0:~ }|
+ {0:~ }|
+ {1: }|
+ aaa |
+ bbb |
+ ]], timeout=100}
+ screen:expect{grid=[[
+ |
+ {1: }|
+ aaa |
+ bbb |
+ ccc |
+ {2:Press ENTER or type command to continue}^ |
+ ]]}
+ feed('<CR>')
+ funcs.jobstop(meths.get_var('id'))
+ end)
end)
pending('exit event follows stdout, stderr', function()