mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
test: add tests for executing commands with backwards range
This commit is contained in:
@@ -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()
|
||||
|
@@ -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()
|
||||
|
Reference in New Issue
Block a user