mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 04:17:01 +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:errmsg')) -- v:errmsg was not updated.
|
||||||
eq('', eval('v:exception'))
|
eq('', eval('v:exception'))
|
||||||
end)
|
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)
|
end)
|
||||||
|
|
||||||
describe('nvim_command_output', function()
|
describe('nvim_command_output', function()
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ local eval = helpers.eval
|
|||||||
local clear = helpers.clear
|
local clear = helpers.clear
|
||||||
local source = helpers.source
|
local source = helpers.source
|
||||||
local exc_exec = helpers.exc_exec
|
local exc_exec = helpers.exc_exec
|
||||||
|
local pcall_err = helpers.pcall_err
|
||||||
local funcs = helpers.funcs
|
local funcs = helpers.funcs
|
||||||
local Screen = require('test.functional.ui.screen')
|
local Screen = require('test.functional.ui.screen')
|
||||||
local command = helpers.command
|
local command = helpers.command
|
||||||
@@ -284,6 +285,14 @@ describe('execute()', function()
|
|||||||
eq('42', eval('g:mes'))
|
eq('42', eval('g:mes'))
|
||||||
end)
|
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()
|
it('captures but does not display output for "silent"', function()
|
||||||
local screen = Screen.new(40, 5)
|
local screen = Screen.new(40, 5)
|
||||||
screen:attach()
|
screen:attach()
|
||||||
|
|||||||
Reference in New Issue
Block a user