aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-08-21 13:38:11 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-08-21 13:38:11 -0300
commitc75d5010b742db83462fc4508cf6dba455f79ca7 (patch)
treefd9cc6bd7e8a3eb4aa4f33226225efd660702e90 /test
parentd5b5063622ab9764a851fdf56c60d14ad0736583 (diff)
parent3d2d44037f27104207005998d9bcb55af1152892 (diff)
downloadrneovim-c75d5010b742db83462fc4508cf6dba455f79ca7.tar.gz
rneovim-c75d5010b742db83462fc4508cf6dba455f79ca7.tar.bz2
rneovim-c75d5010b742db83462fc4508cf6dba455f79ca7.zip
Merge PR #3210 'Bugfixes'
Helped-by: oni-link <knil.ino@gmail.com> Reviewed-by: oni-link <knil.ino@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/functional/job/job_spec.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/functional/job/job_spec.lua b/test/functional/job/job_spec.lua
index 7085d61cc7..bdaf2a7ec6 100644
--- a/test/functional/job/job_spec.lua
+++ b/test/functional/job/job_spec.lua
@@ -6,6 +6,7 @@ local clear, eq, eval, execute, expect, feed, insert, neq, next_msg, nvim,
helpers.insert, helpers.neq, helpers.next_message, helpers.nvim,
helpers.nvim_dir, helpers.ok, helpers.run, helpers.session, helpers.source,
helpers.stop, helpers.wait, helpers.write_file
+local Screen = require('test.functional.ui.screen')
describe('jobs', function()
@@ -188,6 +189,41 @@ describe('jobs', function()
eq({'notification', 'exit', {45, 10}}, next_msg())
end)
+ it('cant redefine callbacks being used by a job', function()
+ local screen = Screen.new()
+ screen:attach()
+ local script = [[
+ function! g:JobHandler(job_id, data, event)
+ endfunction
+
+ let g:callbacks = {
+ \ 'on_stdout': function('g:JobHandler'),
+ \ 'on_stderr': function('g:JobHandler'),
+ \ 'on_exit': function('g:JobHandler')
+ \ }
+ let job = jobstart('cat -', g:callbacks)
+ ]]
+ source(script)
+ feed(':function! g:JobHandler(job_id, data, event)<cr>')
+ feed(':endfunction<cr>')
+ screen:expect([[
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ :function! g:JobHandler(job_id, data, event) |
+ : :endfunction |
+ E127: Cannot redefine function JobHandler: It is in u|
+ se |
+ Press ENTER or type command to continue^ |
+ ]])
+ end)
+
describe('jobwait', function()
it('returns a list of status codes', function()
source([[