aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/vim_spec.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-08-02 13:00:13 +0200
committerbfredl <bjorn.linse@gmail.com>2023-08-07 13:18:11 +0200
commit0b351c3740d621689b17267171e162abd421e759 (patch)
tree5773dd83f2b93eda90d10376bb608f19e41da9e0 /test/functional/api/vim_spec.lua
parent6c0812d92e0c7937b913175b8856064cb45f55c2 (diff)
downloadrneovim-0b351c3740d621689b17267171e162abd421e759.tar.gz
rneovim-0b351c3740d621689b17267171e162abd421e759.tar.bz2
rneovim-0b351c3740d621689b17267171e162abd421e759.zip
test(api): update tests to new error messages
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r--test/functional/api/vim_spec.lua9
1 files changed, 4 insertions, 5 deletions
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 } }]]))