diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2015-04-02 11:55:17 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2015-04-02 11:55:17 -0300 |
commit | 1b2e991cf26eceed6d321b31e87be8ecdfe3a6ff (patch) | |
tree | f568497c53daaf4b32bd20655fc5845bf497ed07 /test | |
parent | b3f07b2468edb02a3104082f6e9730f2c9221c19 (diff) | |
parent | 617878f7473a9f2980df2627601c38fd9f5029ca (diff) | |
download | rneovim-1b2e991cf26eceed6d321b31e87be8ecdfe3a6ff.tar.gz rneovim-1b2e991cf26eceed6d321b31e87be8ecdfe3a6ff.tar.bz2 rneovim-1b2e991cf26eceed6d321b31e87be8ecdfe3a6ff.zip |
Merge PR #2314 'Add vimexpect library and example gdb plugin'
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/job/job_spec.lua | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/test/functional/job/job_spec.lua b/test/functional/job/job_spec.lua index c1c559eb34..c517ae4c1b 100644 --- a/test/functional/job/job_spec.lua +++ b/test/functional/job/job_spec.lua @@ -200,19 +200,22 @@ describe('jobs', function() it('will run callbacks while waiting', function() source([[ let g:dict = {'id': 10} - let g:l = [] - function g:dict.on_stdout(id, data) - call add(g:l, a:data[0]) + let g:exits = 0 + function g:dict.on_exit(id, code) + if a:code != 5 + throw 'Error!' + endif + let g:exits += 1 endfunction call jobwait([ - \ jobstart([&sh, '-c', 'sleep 0.010; echo 4'], g:dict), - \ jobstart([&sh, '-c', 'sleep 0.030; echo 5'], g:dict), - \ jobstart([&sh, '-c', 'sleep 0.050; echo 6'], g:dict), - \ jobstart([&sh, '-c', 'sleep 0.070; echo 7'], g:dict) + \ jobstart([&sh, '-c', 'sleep 0.010; exit 5'], g:dict), + \ jobstart([&sh, '-c', 'sleep 0.030; exit 5'], g:dict), + \ jobstart([&sh, '-c', 'sleep 0.050; exit 5'], g:dict), + \ jobstart([&sh, '-c', 'sleep 0.070; exit 5'], g:dict) \ ]) - call rpcnotify(g:channel, 'wait', g:l) + call rpcnotify(g:channel, 'wait', g:exits) ]]) - eq({'notification', 'wait', {{'4', '5', '6', '7'}}}, next_msg()) + eq({'notification', 'wait', {4}}, next_msg()) end) it('will return status codes in the order of passed ids', function() @@ -250,8 +253,8 @@ describe('jobs', function() it('will return -1 if the wait timed out', function() source([[ call rpcnotify(g:channel, 'wait', jobwait([ - \ jobstart([&sh, '-c', 'sleep 0.05; exit 4']), - \ jobstart([&sh, '-c', 'sleep 0.3; exit 5']), + \ jobstart([&sh, '-c', 'exit 4']), + \ jobstart([&sh, '-c', 'sleep 10000; exit 5']), \ ], 100)) ]]) eq({'notification', 'wait', {{4, -1}}}, next_msg()) |