# HG changeset patch # User Christian Brabandt # Date 1483881304 -3600 # Node ID 3ea703795a4f02df28ac851fc525248781670fb2 # Parent d6990fcba5594a602d3e9b1e476e65dd50357a63 commit https://github.com/vim/vim/commit/31f19ce0a052f7c76d44a9a190e468c79cf5d56d Author: Bram Moolenaar Date: Sun Jan 8 14:14:43 2017 +0100 patch 8.0.0154: system() test fails on OS/X Problem: system() test fails on OS/X. Solution: Deal with leading spaces. diff --git a/src/testdir/test_system.vim b/src/testdir/test_system.vim --- a/src/testdir/test_system.vim +++ b/src/testdir/test_system.vim @@ -19,13 +19,21 @@ function! Test_System() call assert_equal('123', system('cat', '123')) call assert_equal(['123'], systemlist('cat', '123')) call assert_equal(["as\df"], systemlist('cat', ["as\df"])) + new Xdummy call setline(1, ['asdf', "pw\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('%')) " On Windows we may get a trailing CR. 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) endif diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -765,6 +765,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 154, +/**/ 153, /**/ 152,