aboutsummaryrefslogtreecommitdiff
path: root/test/functional/vimscript
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-05-05 09:50:36 +0800
committerGitHub <noreply@github.com>2023-05-05 09:50:36 +0800
commit9ded4c127599b821d0875db9d63049b5970437a4 (patch)
tree04ab960fec3aaaf6d139164e27ee8c4c6ff8f900 /test/functional/vimscript
parentd79e72621226cae91c8d8f6ad23e3c0670e1211c (diff)
parentbdaaf2e8e113f8c32c70f83b60e0bf3f648357c1 (diff)
downloadrneovim-9ded4c127599b821d0875db9d63049b5970437a4.tar.gz
rneovim-9ded4c127599b821d0875db9d63049b5970437a4.tar.bz2
rneovim-9ded4c127599b821d0875db9d63049b5970437a4.zip
Merge pull request #23483 from zeertzjq/vim-8.2.3135
vim-patch:8.2.{3135,4890,4892},9.0.0250: error message improvements
Diffstat (limited to 'test/functional/vimscript')
-rw-r--r--test/functional/vimscript/execute_spec.lua16
-rw-r--r--test/functional/vimscript/input_spec.lua30
-rw-r--r--test/functional/vimscript/map_functions_spec.lua4
-rw-r--r--test/functional/vimscript/null_spec.lua4
-rw-r--r--test/functional/vimscript/writefile_spec.lua8
5 files changed, 31 insertions, 31 deletions
diff --git a/test/functional/vimscript/execute_spec.lua b/test/functional/vimscript/execute_spec.lua
index 5fe3d787cb..17edf5c93e 100644
--- a/test/functional/vimscript/execute_spec.lua
+++ b/test/functional/vimscript/execute_spec.lua
@@ -93,17 +93,17 @@ describe('execute()', function()
it('captures errors', function()
local ret
ret = exc_exec('call execute(0.0)')
- eq('Vim(call):E806: using Float as a String', ret)
+ eq('Vim(call):E806: Using a Float as a String', ret)
ret = exc_exec('call execute(v:_null_dict)')
- eq('Vim(call):E731: using Dictionary as a String', ret)
+ eq('Vim(call):E731: Using a Dictionary as a String', ret)
ret = exc_exec('call execute(function("tr"))')
- eq('Vim(call):E729: using Funcref as a String', ret)
+ eq('Vim(call):E729: Using a Funcref as a String', ret)
ret = exc_exec('call execute(["echo 42", 0.0, "echo 44"])')
- eq('Vim:E806: using Float as a String', ret)
+ eq('Vim:E806: Using a Float as a String', ret)
ret = exc_exec('call execute(["echo 42", v:_null_dict, "echo 44"])')
- eq('Vim:E731: using Dictionary as a String', ret)
+ eq('Vim:E731: Using a Dictionary as a String', ret)
ret = exc_exec('call execute(["echo 42", function("tr"), "echo 44"])')
- eq('Vim:E729: using Funcref as a String', ret)
+ eq('Vim:E729: Using a Funcref as a String', ret)
end)
it('captures output with highlights', function()
@@ -322,10 +322,10 @@ describe('execute()', function()
it('propagates errors for "" and "silent"', function()
local ret
ret = exc_exec('call execute(0.0, "")')
- eq('Vim(call):E806: using Float as a String', ret)
+ eq('Vim(call):E806: Using a Float as a String', ret)
ret = exc_exec('call execute(v:_null_dict, "silent")')
- eq('Vim(call):E731: using Dictionary as a String', ret)
+ eq('Vim(call):E731: Using a Dictionary as a String', ret)
ret = exc_exec('call execute("echo add(1, 1)", "")')
eq('Vim(echo):E897: List or Blob required', ret)
diff --git a/test/functional/vimscript/input_spec.lua b/test/functional/vimscript/input_spec.lua
index f50b39c2c5..d1643a799a 100644
--- a/test/functional/vimscript/input_spec.lua
+++ b/test/functional/vimscript/input_spec.lua
@@ -222,17 +222,17 @@ describe('input()', function()
eq('DEF2', meths.get_var('var'))
end)
it('errors out on invalid inputs', function()
- eq('Vim(call):E730: using List as a String',
+ eq('Vim(call):E730: Using a List as a String',
exc_exec('call input([])'))
- eq('Vim(call):E730: using List as a String',
+ eq('Vim(call):E730: Using a List as a String',
exc_exec('call input("", [])'))
- eq('Vim(call):E730: using List as a String',
+ eq('Vim(call):E730: Using a List as a String',
exc_exec('call input("", "", [])'))
- eq('Vim(call):E730: using List as a String',
+ eq('Vim(call):E730: Using a List as a String',
exc_exec('call input({"prompt": []})'))
- eq('Vim(call):E730: using List as a String',
+ eq('Vim(call):E730: Using a List as a String',
exc_exec('call input({"default": []})'))
- eq('Vim(call):E730: using List as a String',
+ eq('Vim(call):E730: Using a List as a String',
exc_exec('call input({"completion": []})'))
eq('Vim(call):E5050: {opts} must be the only argument',
exc_exec('call input({}, "default")'))
@@ -418,17 +418,17 @@ describe('inputdialog()', function()
eq('DEF2', meths.get_var('var'))
end)
it('errors out on invalid inputs', function()
- eq('Vim(call):E730: using List as a String',
+ eq('Vim(call):E730: Using a List as a String',
exc_exec('call inputdialog([])'))
- eq('Vim(call):E730: using List as a String',
+ eq('Vim(call):E730: Using a List as a String',
exc_exec('call inputdialog("", [])'))
- eq('Vim(call):E730: using List as a String',
+ eq('Vim(call):E730: Using a List as a String',
exc_exec('call inputdialog("", "", [])'))
- eq('Vim(call):E730: using List as a String',
+ eq('Vim(call):E730: Using a List as a String',
exc_exec('call inputdialog({"prompt": []})'))
- eq('Vim(call):E730: using List as a String',
+ eq('Vim(call):E730: Using a List as a String',
exc_exec('call inputdialog({"default": []})'))
- eq('Vim(call):E730: using List as a String',
+ eq('Vim(call):E730: Using a List as a String',
exc_exec('call inputdialog({"completion": []})'))
eq('Vim(call):E5050: {opts} must be the only argument',
exc_exec('call inputdialog({}, "default")'))
@@ -512,13 +512,13 @@ describe('confirm()', function()
eq(1, meths.get_var('a'))
end
- eq('Vim(call):E730: using List as a String',
+ eq('Vim(call):E730: Using a List as a String',
pcall_err(command, 'call confirm([])'))
- eq('Vim(call):E730: using List as a String',
+ eq('Vim(call):E730: Using a List as a String',
pcall_err(command, 'call confirm("Are you sure?", [])'))
eq('Vim(call):E745: Using a List as a Number',
pcall_err(command, 'call confirm("Are you sure?", "&Yes\n&No\n", [])'))
- eq('Vim(call):E730: using List as a String',
+ eq('Vim(call):E730: Using a List as a String',
pcall_err(command, 'call confirm("Are you sure?", "&Yes\n&No\n", 0, [])'))
end)
diff --git a/test/functional/vimscript/map_functions_spec.lua b/test/functional/vimscript/map_functions_spec.lua
index ba1b4d7a76..2c8fe69428 100644
--- a/test/functional/vimscript/map_functions_spec.lua
+++ b/test/functional/vimscript/map_functions_spec.lua
@@ -246,9 +246,9 @@ describe('mapset()', function()
end)
it('does not leak memory if lhs is missing', function()
- eq('Vim:E460: entries missing in mapset() dict argument',
+ eq('Vim:E460: Entries missing in mapset() dict argument',
pcall_err(exec_lua, [[vim.fn.mapset('n', false, {rhs = 'foo'})]]))
- eq('Vim:E460: entries missing in mapset() dict argument',
+ eq('Vim:E460: Entries missing in mapset() dict argument',
pcall_err(exec_lua, [[vim.fn.mapset('n', false, {callback = function() end})]]))
end)
end)
diff --git a/test/functional/vimscript/null_spec.lua b/test/functional/vimscript/null_spec.lua
index 1153baac46..4ba5dd6b45 100644
--- a/test/functional/vimscript/null_spec.lua
+++ b/test/functional/vimscript/null_spec.lua
@@ -65,7 +65,7 @@ describe('NULL', function()
-- Correct behaviour
null_expr_test('can be indexed with error message for empty list', 'L[0]',
- 'E684: list index out of range: 0', nil)
+ 'E684: List index out of range: 0', nil)
null_expr_test('can be splice-indexed', 'L[:]', 0, {})
null_expr_test('is not locked', 'islocked("v:_null_list")', 0, 0)
null_test('is accepted by :for', 'for x in L|throw x|endfor', 0)
@@ -80,7 +80,7 @@ describe('NULL', function()
null_expr_test('can be copied', 'copy(L)', 0, {})
null_expr_test('can be deepcopied', 'deepcopy(L)', 0, {})
null_expr_test('does not crash when indexed', 'L[1]',
- 'E684: list index out of range: 1', nil)
+ 'E684: List index out of range: 1', nil)
null_expr_test('does not crash call()', 'call("arglistid", L)', 0, 0)
null_expr_test('does not crash col()', 'col(L)', 0, 0)
null_expr_test('does not crash virtcol()', 'virtcol(L)', 0, 0)
diff --git a/test/functional/vimscript/writefile_spec.lua b/test/functional/vimscript/writefile_spec.lua
index c816efd37b..521a4eb2b1 100644
--- a/test/functional/vimscript/writefile_spec.lua
+++ b/test/functional/vimscript/writefile_spec.lua
@@ -145,13 +145,13 @@ describe('writefile()', function()
pcall_err(command, ('call writefile(%s, "%s", "b")'):format(arg, fname)))
end
for _, args in ipairs({'[], %s, "b"', '[], "' .. fname .. '", %s'}) do
- eq('Vim(call):E806: using Float as a String',
+ eq('Vim(call):E806: Using a Float as a String',
pcall_err(command, ('call writefile(%s)'):format(args:format('0.0'))))
- eq('Vim(call):E730: using List as a String',
+ eq('Vim(call):E730: Using a List as a String',
pcall_err(command, ('call writefile(%s)'):format(args:format('[]'))))
- eq('Vim(call):E731: using Dictionary as a String',
+ eq('Vim(call):E731: Using a Dictionary as a String',
pcall_err(command, ('call writefile(%s)'):format(args:format('{}'))))
- eq('Vim(call):E729: using Funcref as a String',
+ eq('Vim(call):E729: Using a Funcref as a String',
pcall_err(command, ('call writefile(%s)'):format(args:format('function("tr")'))))
end
eq('Vim(call):E5060: Unknown flag: «»',