neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 3a1e17e3a1767b4ff8a082150f7f9d6bda50cc8f
parent 4a098b97e53551a3383e669f4730be542c61e012
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Fri,  5 May 2023 19:03:08 +0800

test: add tests for executing commands with backwards range

Diffstat:
Mtest/functional/api/vim_spec.lua | 6++++++
Mtest/functional/vimscript/execute_spec.lua | 9+++++++++
2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua @@ -361,6 +361,12 @@ describe('API', function() eq('', eval('v:errmsg')) -- v:errmsg was not updated. eq('', eval('v:exception')) end) + + it('gives E493 instead of prompting on backwards range', function() + command('split') + eq('Vim(windo):E493: Backwards range given: 2,1windo echo', + pcall_err(command, '2,1windo echo')) + end) end) describe('nvim_command_output', function() diff --git 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 @@ -284,6 +285,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()