aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core/job_partial_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/core/job_partial_spec.lua')
-rw-r--r--test/functional/core/job_partial_spec.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/functional/core/job_partial_spec.lua b/test/functional/core/job_partial_spec.lua
new file mode 100644
index 0000000000..b60f239db9
--- /dev/null
+++ b/test/functional/core/job_partial_spec.lua
@@ -0,0 +1,27 @@
+local helpers = require('test.functional.helpers')(after_each)
+local clear, eq, next_msg, nvim, source = helpers.clear, helpers.eq,
+ helpers.next_message, helpers.nvim, helpers.source
+
+if helpers.pending_win32(pending) then return end
+
+describe('jobs with partials', function()
+ local channel
+
+ before_each(function()
+ clear()
+ channel = nvim('get_api_info')[1]
+ nvim('set_var', 'channel', channel)
+ end)
+
+ it('works correctly', function()
+ source([[
+ function PrintArgs(a1, a2, id, data, event)
+ call rpcnotify(g:channel, '1', a:a1, a:a2, a:data, a:event)
+ endfunction
+ let Callback = function('PrintArgs', ["foo", "bar"])
+ let g:job_opts = {'on_stdout': Callback}
+ call jobstart(['echo'], g:job_opts)
+ ]])
+ eq({'notification', '1', {'foo', 'bar', {'', ''}, 'stdout'}}, next_msg())
+ end)
+end)