]> granicus.if.org Git - vim/commitdiff
patch 8.0.0154: system() test fails on OS/X v8.0.0154
authorBram Moolenaar <Bram@vim.org>
Sun, 8 Jan 2017 13:14:43 +0000 (14:14 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 8 Jan 2017 13:14:43 +0000 (14:14 +0100)
Problem:    system() test fails on OS/X.
Solution:   Deal with leading spaces.

src/testdir/test_system.vim
src/version.c

index be00d180c4046ac285c738f7030499f67f0e2a4c..0446bd91058785e1ce0d0e89f46f4eba82c8927b 100644 (file)
@@ -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\<NL>df"], systemlist('cat', ["as\<NL>df"]))
+
   new Xdummy
   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('%'))
   " 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
 
index a1a74696afde6d940213fa60a2180465ec1604fa..368e6bea32a3054fe46c19ac00d5116725317abb 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    154,
 /**/
     153,
 /**/