Skip to content

Commit 31f19ce

Browse files
committed
patch 8.0.0154: system() test fails on OS/X
Problem: system() test fails on OS/X. Solution: Deal with leading spaces.
1 parent 9d9c356 commit 31f19ce

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/testdir/test_system.vim

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,21 @@ function! Test_System()
1919
call assert_equal('123', system('cat', '123'))
2020
call assert_equal(['123'], systemlist('cat', '123'))
2121
call assert_equal(["as\<NL>df"], systemlist('cat', ["as\<NL>df"]))
22+
2223
new Xdummy
2324
call setline(1, ['asdf', "pw\<NL>er", 'xxxx'])
24-
call assert_equal("3\n", system('wc -l', bufnr('%')))
25+
let out = system('wc -l', bufnr('%'))
26+
" On OS/X we get leading spaces
27+
let out = substitute(out, '^ *', '', '')
28+
call assert_equal("3\n", out)
2529

2630
let out = systemlist('wc -l', bufnr('%'))
2731
" On Windows we may get a trailing CR.
2832
if out != ["3\r"]
33+
" On OS/X we get leading spaces
34+
if type(out) == v:t_list
35+
let out[0] = substitute(out[0], '^ *', '', '')
36+
endif
2937
call assert_equal(['3'], out)
3038
endif
3139

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
154,
767769
/**/
768770
153,
769771
/**/

0 commit comments

Comments
 (0)