aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Ennen <mike.ennen@gmail.com>2016-11-11 13:13:55 -0700
committerJames McCoy <jamessan@jamessan.com>2016-12-12 10:17:35 -0500
commit5e4eb18eb0242794c0b3a622f7acf0d3e6856c05 (patch)
treee31b25acaf30023616d4f469af5d067befd30556 /test
parent0f681c80e1e9c9060394365dae12f8ebd5736176 (diff)
downloadrneovim-5e4eb18eb0242794c0b3a622f7acf0d3e6856c05.tar.gz
rneovim-5e4eb18eb0242794c0b3a622f7acf0d3e6856c05.tar.bz2
rneovim-5e4eb18eb0242794c0b3a622f7acf0d3e6856c05.zip
Add some tests and cleanup.
Diffstat (limited to 'test')
-rw-r--r--test/functional/core/job_partial_spec.lua27
-rw-r--r--test/functional/ex_cmds/dict_notifications_spec.lua2
-rw-r--r--test/functional/terminal/buffer_spec.lua2
3 files changed, 29 insertions, 2 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)
diff --git a/test/functional/ex_cmds/dict_notifications_spec.lua b/test/functional/ex_cmds/dict_notifications_spec.lua
index e6dc0782fb..e6f7609016 100644
--- a/test/functional/ex_cmds/dict_notifications_spec.lua
+++ b/test/functional/ex_cmds/dict_notifications_spec.lua
@@ -253,7 +253,7 @@ describe('dictionary change notifications', function()
command('call g:ReplaceWatcher2()')
command('let g:key = "value"')
eq({'notification', '2b', {'key', {old = 'v2', new = 'value'}}}, next_msg())
-
+
end)
end)
end)
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua
index 427aa011e9..cecd67d7fa 100644
--- a/test/functional/terminal/buffer_spec.lua
+++ b/test/functional/terminal/buffer_spec.lua
@@ -167,7 +167,7 @@ describe('terminal buffer', function()
local tbuf = eval('bufnr("%")')
source([[
- function! SplitWindow()
+ function! SplitWindow(id, data, event)
new
call feedkeys("iabc\<Esc>")
endfunction