To: vim_dev@googlegroups.com Subject: Patch 8.0.0153 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0153 (after 8.0.0151) Problem: system() test fails on MS-Windows. Solution: Deal when extra space and CR. Files: src/testdir/test_system.vim *** ../vim-8.0.0152/src/testdir/test_system.vim 2017-01-08 13:25:47.626339783 +0100 --- src/testdir/test_system.vim 2017-01-08 13:51:25.560513157 +0100 *************** *** 4,19 **** if !executable('echo') || !executable('cat') || !executable('wc') return endif ! call assert_equal("123\n", system('echo 123')) ! call assert_equal(['123'], systemlist('echo 123')) 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('%'))) ! call assert_equal(['3'], systemlist('wc -l', bufnr('%'))) ! call assert_equal(['asdf', "pw\er", 'xxxx'], systemlist('cat', bufnr('%'))) bwipe! call assert_fails('call system("wc -l", 99999)', 'E86:') --- 4,39 ---- if !executable('echo') || !executable('cat') || !executable('wc') return endif ! let out = system('echo 123') ! " On Windows we may get a trailing space. ! if out != "123 \n" ! call assert_equal("123\n", out) ! endif ! ! let out = systemlist('echo 123') ! " On Windows we may get a trailing space and CR. ! if out != ["123 \r"] ! call assert_equal(['123'], out) ! endif ! 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 = systemlist('wc -l', bufnr('%')) ! " On Windows we may get a trailing CR. ! if out != ["3\r"] ! call assert_equal(['3'], out) ! endif ! ! let out = systemlist('cat', bufnr('%')) ! " On Windows we may get a trailing CR. ! if out != ["asdf\r", "pw\er\r", "xxxx\r"] ! call assert_equal(['asdf', "pw\er", 'xxxx'], out) ! endif bwipe! call assert_fails('call system("wc -l", 99999)', 'E86:') *** ../vim-8.0.0152/src/version.c 2017-01-08 13:38:53.028502710 +0100 --- src/version.c 2017-01-08 13:52:33.194418853 +0100 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 153, /**/ -- hundred-and-one symptoms of being an internet addict: 218. Your spouse hands you a gift wrapped magnet with your PC's name on it and you accuse him or her of genocide. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///