Add some tests and cleanup.

This commit is contained in:
Michael Ennen 2016-11-11 13:13:55 -07:00 committed by James McCoy
parent 0f681c80e1
commit 5e4eb18eb0
7 changed files with 33 additions and 5 deletions

View File

@ -418,7 +418,7 @@ if(NOT BUSTED_OUTPUT_TYPE)
if(WIN32)
set(BUSTED_OUTPUT_TYPE "plainTerminal")
else()
set(BUSTED_OUTPUT_TYPE "gtest")
set(BUSTED_OUTPUT_TYPE "utfTerminal")
endif()
endif()

View File

@ -1,5 +1,6 @@
*eval.txt* For Vim version 7.4. Last change: 2016 Jun 04
VIM REFERENCE MANUAL by Bram Moolenaar

View File

@ -9664,7 +9664,7 @@ static void f_function(typval_T *argvars, typval_T *rettv, FunPtr fptr)
}
if (arg_idx > 0) {
if (argvars[arg_idx].v_type != VAR_LIST) {
EMSG(_("E923: Second argument of function() must be"
EMSG(_("E923: Second argument of function() must be "
"a list or a dict"));
xfree(name);
return;

View File

@ -908,7 +908,7 @@ char *encode_tv2json(typval_T *tv, size_t *len)
mpstack, objname)
#define TYPVAL_ENCODE_CONV_PARTIAL(partial) \
return conv_error(_("E951: Error while dumping %s, %s: " \
return conv_error(_("E5004: Error while dumping %s, %s: " \
"attempt to dump partial"), \
mpstack, objname)

View File

@ -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)

View File

@ -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)

View File

@ -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