diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-09-03 10:25:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-03 10:25:27 -0700 |
commit | 38806f23edfcba8cb7f7b80039d268ae3ffb0557 (patch) | |
tree | 95d2a179bf8b28c8ce4907cdd4def35c5db423df | |
parent | 8b8ecf44f2cda43bbd710ec22ef99439b71888cd (diff) | |
download | rneovim-38806f23edfcba8cb7f7b80039d268ae3ffb0557.tar.gz rneovim-38806f23edfcba8cb7f7b80039d268ae3ffb0557.tar.bz2 rneovim-38806f23edfcba8cb7f7b80039d268ae3ffb0557.zip |
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] = '' } } } }
-rw-r--r-- | test/functional/core/job_spec.lua | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua index 3a1be7bc52..88951e5b51 100644 --- a/test/functional/core/job_spec.lua +++ b/test/functional/core/job_spec.lua @@ -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() |