diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2018-05-18 10:10:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-18 10:10:45 +0200 |
commit | 0ed297bdb495fa072053b3e28e0c504c7107cf5c (patch) | |
tree | f40a41f9247c9532f09e1aaecba5f2f3357335c0 /test | |
parent | e121b1dbe78cdf7ad46f493ca3a1cb83c190f719 (diff) | |
parent | a676c658cc7aaba25321d3f3dd5d3374d7044414 (diff) | |
download | rneovim-0ed297bdb495fa072053b3e28e0c504c7107cf5c.tar.gz rneovim-0ed297bdb495fa072053b3e28e0c504c7107cf5c.tar.bz2 rneovim-0ed297bdb495fa072053b3e28e0c504c7107cf5c.zip |
Merge pull request #8381 from bfredl/chancrash
channel: avoid references to non-rooted vimL list with output
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/core/job_spec.lua | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua index e90339b0cd..4a21444ee0 100644 --- a/test/functional/core/job_spec.lua +++ b/test/functional/core/job_spec.lua @@ -433,9 +433,25 @@ describe('jobs', function() 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()) + + local expected = {'1', '2', '3', '4', '5', ''} + local chunks = eval('d.data') + local received = {''} + for i, chunk in ipairs(chunks) do + if i < #chunks then + -- if chunks got joined, a spurious [''] callback was not sent + neq({''}, chunk) + else + -- but EOF callback is still sent + eq({''}, chunk) + end + received[#received] = received[#received]..chunk[1] + for j = 2, #chunk do + received[#received+1] = chunk[j] + end + end + eq(expected, received) end) it('jobstart() works with partial functions', function() |