diff options
author | Michael Ennen <mike.ennen@gmail.com> | 2016-11-11 13:13:55 -0700 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2016-12-12 10:17:35 -0500 |
commit | 5e4eb18eb0242794c0b3a622f7acf0d3e6856c05 (patch) | |
tree | e31b25acaf30023616d4f469af5d067befd30556 | |
parent | 0f681c80e1e9c9060394365dae12f8ebd5736176 (diff) | |
download | rneovim-5e4eb18eb0242794c0b3a622f7acf0d3e6856c05.tar.gz rneovim-5e4eb18eb0242794c0b3a622f7acf0d3e6856c05.tar.bz2 rneovim-5e4eb18eb0242794c0b3a622f7acf0d3e6856c05.zip |
Add some tests and cleanup.
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 1 | ||||
-rw-r--r-- | src/nvim/eval.c | 2 | ||||
-rw-r--r-- | src/nvim/eval/encode.c | 2 | ||||
-rw-r--r-- | test/functional/core/job_partial_spec.lua | 27 | ||||
-rw-r--r-- | test/functional/ex_cmds/dict_notifications_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/terminal/buffer_spec.lua | 2 |
7 files changed, 33 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b8411b6fb5..cb8302deb7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 585b016c7d..367f64df9b 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,5 +1,6 @@ *eval.txt* For Vim version 7.4. Last change: 2016 Jun 04 + VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 043e799b4e..a205c37d6e 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -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; diff --git a/src/nvim/eval/encode.c b/src/nvim/eval/encode.c index 51393e5337..61d7a38007 100644 --- a/src/nvim/eval/encode.c +++ b/src/nvim/eval/encode.c @@ -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) 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 |