mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
test: enable "exit event follows stdout, stderr" [ci skip] #10929
- Update the test to work with changes since it was originally written. - Keep the test pending() because it still fails: Expected objects to be the same. Passed in: (table: 0x50ce9e38) { [1] = { [1] = 'notification' [2] = 'stderr' [3] = { [1] = 0 [2] = { [1] = '' } } } *[2] = { [1] = 'notification' [2] = 'stdout' *[3] = { [1] = 0 *[2] = { *[1] = '' } } } [3] = { [1] = 'notification' [2] = 'exit' [3] = { [1] = 0 [2] = 143 } } } Expected: (table: 0x50ce9870) { [1] = { [1] = 'notification' [2] = 'stderr' [3] = { [1] = 0 [2] = { [1] = '' } } } *[2] = { [1] = 'notification' [2] = 'stdout' *[3] = { [1] = 0 *[2] = { *[1] = 'abcdef' } } } [3] = { [1] = 'notification' [2] = 'stdout' [3] = { [1] = 0 [2] = { [1] = '' } } } }
This commit is contained in:
@@ -733,15 +733,28 @@ describe('jobs', function()
|
||||
end)
|
||||
end)
|
||||
|
||||
-- FIXME need to wait until jobsend succeeds before calling jobstop
|
||||
pending('will only emit the "exit" event after "stdout" and "stderr"', function()
|
||||
nvim('command', "let g:job_opts.on_stderr = function('s:OnEvent')")
|
||||
pending('exit event follows stdout, stderr', function()
|
||||
nvim('command', "let g:job_opts.on_stderr = function('OnEvent')")
|
||||
nvim('command', "let j = jobstart(['cat', '-'], g:job_opts)")
|
||||
local jobid = nvim('eval', 'j')
|
||||
nvim('eval', 'jobsend(j, "abcdef")')
|
||||
nvim('eval', 'jobstop(j)')
|
||||
eq({'notification', 'j', {0, {jobid, 'stdout', {'abcdef'}}}}, next_msg())
|
||||
eq({'notification', 'j', {0, {jobid, 'exit'}}}, next_msg())
|
||||
expect_msg_seq(
|
||||
{ {'notification', 'stdout', {0, {'abcdef'}}},
|
||||
{'notification', 'stdout', {0, {''}}},
|
||||
{'notification', 'stderr', {0, {''}}},
|
||||
},
|
||||
-- Alternative sequence:
|
||||
{ {'notification', 'stderr', {0, {''}}},
|
||||
{'notification', 'stdout', {0, {'abcdef'}}},
|
||||
{'notification', 'stdout', {0, {''}}},
|
||||
},
|
||||
-- Alternative sequence:
|
||||
{ {'notification', 'stdout', {0, {'abcdef'}}},
|
||||
{'notification', 'stderr', {0, {''}}},
|
||||
{'notification', 'stdout', {0, {''}}},
|
||||
}
|
||||
)
|
||||
eq({'notification', 'exit', {0, 143}}, next_msg())
|
||||
end)
|
||||
|
||||
it('cannot have both rpc and pty options', function()
|
||||
|
Reference in New Issue
Block a user