aboutsummaryrefslogtreecommitdiff
path: root/test/functional/vimscript/execute_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
commit1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch)
treecd08258054db80bb9a11b1061bb091c70b76926a /test/functional/vimscript/execute_spec.lua
parenteaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-1b7b916b7631ddf73c38e3a0070d64e4636cb2f3.tar.gz
rneovim-1b7b916b7631ddf73c38e3a0070d64e4636cb2f3.tar.bz2
rneovim-1b7b916b7631ddf73c38e3a0070d64e4636cb2f3.zip
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'test/functional/vimscript/execute_spec.lua')
-rw-r--r--test/functional/vimscript/execute_spec.lua26
1 files changed, 14 insertions, 12 deletions
diff --git a/test/functional/vimscript/execute_spec.lua b/test/functional/vimscript/execute_spec.lua
index 5fe3d787cb..bb28938708 100644
--- a/test/functional/vimscript/execute_spec.lua
+++ b/test/functional/vimscript/execute_spec.lua
@@ -4,6 +4,7 @@ local eval = helpers.eval
local clear = helpers.clear
local source = helpers.source
local exc_exec = helpers.exc_exec
+local pcall_err = helpers.pcall_err
local funcs = helpers.funcs
local Screen = require('test.functional.ui.screen')
local command = helpers.command
@@ -92,18 +93,14 @@ 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)
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)
- ret = exc_exec('call execute(["echo 42", 0.0, "echo 44"])')
- eq('Vim:E806: using Float as a String', ret)
+ eq('Vim(call):E729: Using a Funcref 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()
@@ -284,6 +281,14 @@ describe('execute()', function()
eq('42', eval('g:mes'))
end)
+ it('gives E493 instead of prompting on backwards range for ""', function()
+ command('split')
+ eq('Vim(windo):E493: Backwards range given: 2,1windo echo',
+ pcall_err(funcs.execute, '2,1windo echo', ''))
+ eq('Vim(windo):E493: Backwards range given: 2,1windo echo',
+ pcall_err(funcs.execute, {'2,1windo echo'}, ''))
+ end)
+
it('captures but does not display output for "silent"', function()
local screen = Screen.new(40, 5)
screen:attach()
@@ -321,11 +326,8 @@ 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)
-
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)