mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.0.0154: system() test fails on OS/X
Problem: system() test fails on OS/X. Solution: Deal with leading spaces.
This commit is contained in:
parent
9d9c356517
commit
31f19ce0a0
@ -19,13 +19,21 @@ function! Test_System()
|
|||||||
call assert_equal('123', system('cat', '123'))
|
call assert_equal('123', system('cat', '123'))
|
||||||
call assert_equal(['123'], systemlist('cat', '123'))
|
call assert_equal(['123'], systemlist('cat', '123'))
|
||||||
call assert_equal(["as\<NL>df"], systemlist('cat', ["as\<NL>df"]))
|
call assert_equal(["as\<NL>df"], systemlist('cat', ["as\<NL>df"]))
|
||||||
|
|
||||||
new Xdummy
|
new Xdummy
|
||||||
call setline(1, ['asdf', "pw\<NL>er", 'xxxx'])
|
call setline(1, ['asdf', "pw\<NL>er", 'xxxx'])
|
||||||
call assert_equal("3\n", system('wc -l', bufnr('%')))
|
let out = system('wc -l', bufnr('%'))
|
||||||
|
" On OS/X we get leading spaces
|
||||||
|
let out = substitute(out, '^ *', '', '')
|
||||||
|
call assert_equal("3\n", out)
|
||||||
|
|
||||||
let out = systemlist('wc -l', bufnr('%'))
|
let out = systemlist('wc -l', bufnr('%'))
|
||||||
" On Windows we may get a trailing CR.
|
" On Windows we may get a trailing CR.
|
||||||
if out != ["3\r"]
|
if out != ["3\r"]
|
||||||
|
" On OS/X we get leading spaces
|
||||||
|
if type(out) == v:t_list
|
||||||
|
let out[0] = substitute(out[0], '^ *', '', '')
|
||||||
|
endif
|
||||||
call assert_equal(['3'], out)
|
call assert_equal(['3'], out)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -764,6 +764,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
154,
|
||||||
/**/
|
/**/
|
||||||
153,
|
153,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user