diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/api/rpc_fixture.lua | 2 | ||||
-rw-r--r-- | test/functional/api/server_requests_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/api/vim_spec.lua | 15 |
3 files changed, 15 insertions, 4 deletions
diff --git a/test/functional/api/rpc_fixture.lua b/test/functional/api/rpc_fixture.lua index 423864740f..e885a525af 100644 --- a/test/functional/api/rpc_fixture.lua +++ b/test/functional/api/rpc_fixture.lua @@ -31,7 +31,7 @@ end local function on_notification(event, args) if event == 'ping' and #args == 0 then - session:notify("vim_eval", "rpcnotify(g:channel, 'pong')") + session:notify("nvim_eval", "rpcnotify(g:channel, 'pong')") end end diff --git a/test/functional/api/server_requests_spec.lua b/test/functional/api/server_requests_spec.lua index e79a60fb10..856e5ca4d2 100644 --- a/test/functional/api/server_requests_spec.lua +++ b/test/functional/api/server_requests_spec.lua @@ -222,7 +222,7 @@ describe('server -> client', function() end) it('returns an error if the request failed', function() - expect_err('Vim:Invalid method name', + expect_err('Vim:Invalid method: does%-not%-exist', eval, "rpcrequest(vim, 'does-not-exist')") end) end) diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 3a686c84e7..e4b343c123 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -20,9 +20,20 @@ local format_string = global_helpers.format_string local intchar2lua = global_helpers.intchar2lua local mergedicts_copy = global_helpers.mergedicts_copy -describe('api', function() +describe('API', function() before_each(clear) + it('validates requests', function() + expect_err('Invalid method: bogus', + request, 'bogus') + expect_err('Invalid method: … の り 。…', + request, '… の り 。…') + expect_err('Invalid method: <empty>', + request, '') + expect_err("can't serialize object", + request, nil) + end) + describe('nvim_command', function() it('works', function() local fname = helpers.tmpname() @@ -924,7 +935,7 @@ describe('api', function() {'i_am_not_a_method', {'xx'}}, {'nvim_set_var', {'avar', 10}}, } - eq({{}, {0, error_types.Exception.id, 'Invalid method name'}}, + eq({{}, {0, error_types.Exception.id, 'Invalid method: i_am_not_a_method'}}, meths.call_atomic(req)) eq(5, meths.get_var('avar')) end) |