diff options
| author | James McCoy <jamessan@jamessan.com> | 2017-01-14 07:49:51 -0500 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-14 07:49:51 -0500 | 
| commit | a265ff448efd0743b308c479ec1defcaeb0c21bb (patch) | |
| tree | 671dd2cfaa0c1429b57c7e0f5fd7b79a8da9c6e9 /test | |
| parent | 58ba3bcbefcad43c7fb163cd54d9a4f6b98a7100 (diff) | |
| parent | bde9bedb0b3e83eb6dd52a5374cc02adabfc2783 (diff) | |
| download | rneovim-a265ff448efd0743b308c479ec1defcaeb0c21bb.tar.gz rneovim-a265ff448efd0743b308c479ec1defcaeb0c21bb.tar.bz2 rneovim-a265ff448efd0743b308c479ec1defcaeb0c21bb.zip | |
Merge pull request #5940 from jamessan/master
job: Consume content from rbuffer before invoking the callback again
Diffstat (limited to 'test')
| -rw-r--r-- | test/functional/core/job_spec.lua | 18 | 
1 files changed, 18 insertions, 0 deletions
| diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua index 75b50aad0a..48a4689545 100644 --- a/test/functional/core/job_spec.lua +++ b/test/functional/core/job_spec.lua @@ -312,6 +312,24 @@ describe('jobs', function()      end)    end) +  it('does not repeat output with slow output handlers', function() +    source([[ +      let d = {'data': []} +      function! d.on_stdout(job, data, event) dict +        call add(self.data, a:data) +        sleep 200m +      endfunction +      if has('win32') +        let cmd = '1,2,3,4,5 | foreach-object -process {echo $_; sleep 0.1}' +      else +        let cmd = ['sh', '-c', 'for i in $(seq 1 5); do echo $i; sleep 0.1; done'] +      endif +      call jobwait([jobstart(cmd, d)]) +      call rpcnotify(g:channel, 'data', d.data) +    ]]) +    eq({'notification', 'data', {{{'1', ''}, {'2', ''}, {'3', ''}, {'4', ''}, {'5', ''}}}}, next_msg()) +  end) +    describe('jobwait', function()      it('returns a list of status codes', function()        source([[ | 
