vim-patch:8.0.0151,3,4 #7389

vim-patch:8.0.0151
Problem:    To pass buffer content to system() and systemlist() one has to
            first create a string or list.
Solution:   Allow passing a buffer number. (LemonBoy,
            closes vim/vim#1240)
12c4492dd3

vim-patch:8.0.0153
Problem:    system() test fails on MS-Windows.
Solution:   Deal when extra space and CR.
9d9c356517

vim-patch:8.0.0154
Problem:    system() test fails on OS/X.
Solution:   Deal with leading spaces.
31f19ce0a0
This commit is contained in:
Justin M. Keyes
2018-01-15 23:14:20 +01:00
parent de0a9548f7
commit f8f7f9d5f5
6 changed files with 101 additions and 13 deletions

View File

@@ -5,6 +5,7 @@ local eq, call, clear, eval, feed_command, feed, nvim =
helpers.eq, helpers.call, helpers.clear, helpers.eval, helpers.feed_command,
helpers.feed, helpers.nvim
local command = helpers.command
local exc_exec = helpers.exc_exec
local iswin = helpers.iswin
local Screen = require('test.functional.ui.screen')
@@ -274,9 +275,12 @@ describe('system()', function()
end)
end)
describe('input passed as Number', function()
it('stringifies the input', function()
eq('1', eval('system("cat", 1)'))
describe('Number input', function()
it('is treated as a buffer id', function()
command("put ='text in buffer 1'")
eq('\ntext in buffer 1\n', eval('system("cat", 1)'))
eq('Vim(echo):E86: Buffer 42 does not exist',
exc_exec('echo system("cat", 42)'))
end)
end)