aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-12-14 16:56:00 +0100
committerJustin M. Keyes <justinkz@gmail.com>2016-12-14 20:52:18 +0100
commit43ba7f4d987fc491de3378eef6b246a697c6e0b0 (patch)
tree6ddaa9431640ec0f4767449942b31697963ec8d3 /test/functional/core
parent8c9cccbcb6bb5ee803f308916d5de1b949e0b13c (diff)
downloadrneovim-43ba7f4d987fc491de3378eef6b246a697c6e0b0.tar.gz
rneovim-43ba7f4d987fc491de3378eef6b246a697c6e0b0.tar.bz2
rneovim-43ba7f4d987fc491de3378eef6b246a697c6e0b0.zip
eval.c: set_selfdict(): Fix invalid memory access.
Diffstat (limited to 'test/functional/core')
-rw-r--r--test/functional/core/job_spec.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua
index fa38671529..e27adc1a51 100644
--- a/test/functional/core/job_spec.lua
+++ b/test/functional/core/job_spec.lua
@@ -303,6 +303,26 @@ describe('jobs', function()
]])
end)
+ it('requires funcrefs for script-local (s:) functions', function()
+ -- Pass job callback names _without_ `function(...)`.
+ source([[
+ function! s:OnEvent(id, data, event) dict
+ let g:job_result = get(self, 'user')
+ endfunction
+ let s:job = jobstart(['echo'], {
+ \ 'on_stdout': 's:OnEvent',
+ \ 'on_stderr': 's:OnEvent',
+ \ 'on_exit': 's:OnEvent',
+ \ 'user': 2349
+ \ })
+ ]])
+
+ -- The behavior is asynchronous, retry until a time limit.
+ helpers.retry(nil, 10000, function()
+ eq("E120:", string.match(eval("v:errmsg"), "E%d*:"))
+ end)
+ end)
+
describe('jobwait', function()
it('returns a list of status codes', function()
source([[