To: vim_dev@googlegroups.com Subject: Patch 7.4.2178 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.2178 Problem: No test for reading from stdin. Solution: Add a test. Files: src/testdir/test_startup.vim, src/testdir/shared.vim *** ../vim-7.4.2177/src/testdir/test_startup.vim 2016-08-07 15:51:35.068558073 +0200 --- src/testdir/test_startup.vim 2016-08-07 16:22:06.413648632 +0200 *************** *** 169,171 **** --- 169,183 ---- endif call delete('Xtestout') endfunc + + func Test_read_stdin() + let after = [ + \ 'write Xtestout', + \ 'quit!', + \ ] + if RunVimPiped([], after, '-', 'echo something | ') + let lines = readfile('Xtestout') + call assert_equal('something', lines[0]) + endif + call delete('Xtestout') + endfunc *** ../vim-7.4.2177/src/testdir/shared.vim 2016-08-07 15:51:35.068558073 +0200 --- src/testdir/shared.vim 2016-08-07 16:28:24.562575939 +0200 *************** *** 122,132 **** endfunc " Run Vim, using the "vimcmd" file and "-u NORC". ! " "before" is a list of commands to be executed before loading plugins. ! " "after" is a list of commands to be executed after loading plugins. " Plugins are not loaded, unless 'loadplugins' is set in "before". " Return 1 if Vim could be executed. func RunVim(before, after, arguments) if !filereadable('vimcmd') return 0 endif --- 122,136 ---- endfunc " Run Vim, using the "vimcmd" file and "-u NORC". ! " "before" is a list of Vim commands to be executed before loading plugins. ! " "after" is a list of Vim commands to be executed after loading plugins. " Plugins are not loaded, unless 'loadplugins' is set in "before". " Return 1 if Vim could be executed. func RunVim(before, after, arguments) + call RunVimPiped(a:before, a:after, a:arguments, '') + endfunc + + func RunVimPiped(before, after, arguments, pipecmd) if !filereadable('vimcmd') return 0 endif *************** *** 145,151 **** if cmd !~ '-u NONE' let cmd = cmd . ' -u NONE' endif ! exe "silent !" . cmd . args . ' ' . a:arguments if len(a:before) > 0 call delete('Xbefore.vim') --- 149,161 ---- if cmd !~ '-u NONE' let cmd = cmd . ' -u NONE' endif ! ! " With pipecmd we can't set VIMRUNTIME. ! if a:pipecmd != '' ! let cmd = substitute(cmd, 'VIMRUNTIME=.*VIMRUNTIME;', '', '') ! endif ! ! exe "silent !" . a:pipecmd . cmd . args . ' ' . a:arguments if len(a:before) > 0 call delete('Xbefore.vim') *** ../vim-7.4.2177/src/version.c 2016-08-07 15:51:35.068558073 +0200 --- src/version.c 2016-08-07 16:19:50.134756338 +0200 *************** *** 765,766 **** --- 765,768 ---- { /* Add new patch number below this line */ + /**/ + 2178, /**/ -- Your company is doomed if your primary product is overhead transparencies. (Scott Adams - The Dilbert principle) /// 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 ///