diff options
Diffstat (limited to 'test/functional/api')
| -rw-r--r-- | test/functional/api/autocmd_spec.lua | 2 | ||||
| -rw-r--r-- | test/functional/api/extmark_spec.lua | 2 | ||||
| -rw-r--r-- | test/functional/api/highlight_spec.lua | 8 | ||||
| -rw-r--r-- | test/functional/api/vim_spec.lua | 9 |
4 files changed, 9 insertions, 12 deletions
diff --git a/test/functional/api/autocmd_spec.lua b/test/functional/api/autocmd_spec.lua index 4cfe8672b1..ba267e7539 100644 --- a/test/functional/api/autocmd_spec.lua +++ b/test/functional/api/autocmd_spec.lua @@ -737,7 +737,7 @@ describe('autocmd api', function() eq("Invalid 'group': 0", pcall_err(meths.exec_autocmds, 'FileType', { group = 0, })) - eq("Invalid 'buffer': expected Integer, got Array", pcall_err(meths.exec_autocmds, 'FileType', { + eq("Invalid 'buffer': expected Buffer, got Array", pcall_err(meths.exec_autocmds, 'FileType', { buffer = {}, })) eq("Invalid 'event' item: expected String, got Array", pcall_err(meths.exec_autocmds, diff --git a/test/functional/api/extmark_spec.lua b/test/functional/api/extmark_spec.lua index ec1c9245ba..6d8e3d8e0a 100644 --- a/test/functional/api/extmark_spec.lua +++ b/test/functional/api/extmark_spec.lua @@ -109,7 +109,7 @@ describe('API/extmarks', function() eq("Invalid 'virt_text_pos': 'foo'", pcall_err(set_extmark, ns, marks[2], 0, 0, { virt_text_pos = 'foo' })) eq("Invalid 'hl_mode': expected String, got Integer", pcall_err(set_extmark, ns, marks[2], 0, 0, { hl_mode = 0 })) eq("Invalid 'hl_mode': 'foo'", pcall_err(set_extmark, ns, marks[2], 0, 0, { hl_mode = 'foo' })) - eq("Invalid 'id': expected positive Integer", pcall_err(set_extmark, ns, {}, 0, 0, { end_col = 1, end_row = 1 })) + eq("Invalid 'id': expected Integer, got Array", pcall_err(set_extmark, ns, {}, 0, 0, { end_col = 1, end_row = 1 })) eq("Invalid mark position: expected 2 Integer items", pcall_err(get_extmarks, ns, {}, {-1, -1})) eq("Invalid mark position: expected mark id Integer or 2-item Array", pcall_err(get_extmarks, ns, true, {-1, -1})) -- No memory leak with virt_text, virt_lines, sign_text diff --git a/test/functional/api/highlight_spec.lua b/test/functional/api/highlight_spec.lua index d3a79327ae..5fa2235018 100644 --- a/test/functional/api/highlight_spec.lua +++ b/test/functional/api/highlight_spec.lua @@ -434,10 +434,8 @@ describe('API: get highlight', function() before_each(clear) it('validation', function() - eq( - 'Invalid highlight name: expected String, got Integer', - pcall_err(meths.get_hl, 0, { name = 177 }) - ) + eq("Invalid 'name': expected String, got Integer", + pcall_err(meths.get_hl, 0, { name = 177 })) eq('Highlight id out of bounds', pcall_err(meths.get_hl, 0, { name = 'Test set hl' })) end) @@ -534,7 +532,7 @@ describe('API: get highlight', function() eq('Highlight id out of bounds', pcall_err(meths.get_hl, 0, { id = 0 })) eq( - 'Invalid highlight id: expected Integer, got String', + "Invalid 'id': expected Integer, got String", pcall_err(meths.get_hl, 0, { id = 'Test_set_hl' }) ) diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 6aa9dcc8fa..70fa80f2a2 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -4112,12 +4112,10 @@ describe('API', function() it('validation', function() eq("Invalid 'cmd': expected non-empty String", pcall_err(meths.cmd, { cmd = ""}, {})) - eq("Invalid 'cmd': expected non-empty String", + eq("Invalid 'cmd': expected String, got Array", pcall_err(meths.cmd, { cmd = {}}, {})) eq("Invalid 'args': expected Array, got Boolean", pcall_err(meths.cmd, { cmd = "set", args = true }, {})) - eq("Invalid 'magic': expected Dict, got Array", - pcall_err(meths.cmd, { cmd = "set", args = {}, magic = {} }, {})) eq("Invalid command arg: expected non-whitespace", pcall_err(meths.cmd, { cmd = "set", args = {' '}, }, {})) eq("Invalid command arg: expected valid type, got Array", @@ -4138,7 +4136,7 @@ describe('API', function() eq("Command cannot accept count: set", pcall_err(meths.cmd, { cmd = "set", args = {}, count = 1 }, {})) - eq("Invalid 'count': expected non-negative Integer", + eq("Invalid 'count': expected Integer, got Boolean", pcall_err(meths.cmd, { cmd = "print", args = {}, count = true }, {})) eq("Invalid 'count': expected non-negative Integer", pcall_err(meths.cmd, { cmd = "print", args = {}, count = -1 }, {})) @@ -4158,9 +4156,10 @@ describe('API', function() -- Lua call allows empty {} for dict item. eq('', exec_lua([[return vim.cmd{ cmd = "set", args = {}, magic = {} }]])) eq('', exec_lua([[return vim.cmd{ cmd = "set", args = {}, mods = {} }]])) + eq('', meths.cmd({ cmd = "set", args = {}, magic = {} }, {})) -- Lua call does not allow non-empty list-like {} for dict item. - eq("Invalid 'magic': expected Dict, got Array", + eq("Invalid 'magic': Expected Dict-like Lua table", pcall_err(exec_lua, [[return vim.cmd{ cmd = "set", args = {}, magic = { 'a' } }]])) eq("Invalid key: 'bogus'", pcall_err(exec_lua, [[return vim.cmd{ cmd = "set", args = {}, magic = { bogus = true } }]])) |