diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 22:40:31 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 22:40:31 +0000 |
commit | 339e2d15cc26fe86988ea06468d912a46c8d6f29 (patch) | |
tree | a6167fc8fcfc6ae2dc102f57b2473858eac34063 /test/functional/vimscript/execute_spec.lua | |
parent | 067dc73729267c0262438a6fdd66e586f8496946 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-339e2d15cc26fe86988ea06468d912a46c8d6f29.tar.gz rneovim-339e2d15cc26fe86988ea06468d912a46c8d6f29.tar.bz2 rneovim-339e2d15cc26fe86988ea06468d912a46c8d6f29.zip |
Merge remote-tracking branch 'upstream/master' into fix_repeatcmdline
Diffstat (limited to 'test/functional/vimscript/execute_spec.lua')
-rw-r--r-- | test/functional/vimscript/execute_spec.lua | 26 |
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) |