diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 21:52:58 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 21:52:58 +0000 |
commit | 931bffbda3668ddc609fc1da8f9eb576b170aa52 (patch) | |
tree | d8c1843a95da5ea0bb4acc09f7e37843d9995c86 /test/functional/core/job_spec.lua | |
parent | 142d9041391780ac15b89886a54015fdc5c73995 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-userreg.tar.gz rneovim-userreg.tar.bz2 rneovim-userreg.zip |
Merge remote-tracking branch 'upstream/master' into userreguserreg
Diffstat (limited to 'test/functional/core/job_spec.lua')
-rw-r--r-- | test/functional/core/job_spec.lua | 41 |
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() |