mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
shell: update execute('!cmd') test to new behavior
And similarly nvim_command_output test
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local global_helpers = require('test.helpers')
|
||||
local eq = helpers.eq
|
||||
local eval = helpers.eval
|
||||
local clear = helpers.clear
|
||||
@@ -9,6 +10,7 @@ local funcs = helpers.funcs
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local command = helpers.command
|
||||
local feed = helpers.feed
|
||||
local uname = global_helpers.uname
|
||||
|
||||
describe('execute()', function()
|
||||
before_each(clear)
|
||||
@@ -118,9 +120,11 @@ describe('execute()', function()
|
||||
feed('<CR>')
|
||||
end)
|
||||
|
||||
-- This matches Vim behavior.
|
||||
it('does not capture shell-command output', function()
|
||||
eq('\n:!echo "foo"\13\n', funcs.execute('!echo "foo"'))
|
||||
-- This deviates from vim behavior, but is consistent
|
||||
-- with how nvim currently displays the output.
|
||||
it('does capture shell-command output', function()
|
||||
local win_lf = (uname() == 'Windows' and '\13') or ''
|
||||
eq('\n:!echo foo\r\n\nfoo'..win_lf..'\n', funcs.execute('!echo foo'))
|
||||
end)
|
||||
|
||||
describe('{silent} argument', function()
|
||||
|
||||
Reference in New Issue
Block a user