Patch 7.4.2172
Problem:    No test for "vim --help".
Solution:   Add a test.
Files:      src/testdir/test_startup.vim, src/testdir/shared.vim


*** ../vim-7.4.2171/src/testdir/test_startup.vim        2016-08-06 
21:37:23.991218032 +0200
--- src/testdir/test_startup.vim        2016-08-06 22:22:02.006089260 +0200
***************
*** 41,47 ****
    call mkdir('Xafter/plugin', 'p')
    call writefile(['let done = 1'], 'Xafter/plugin/later.vim')
  
!   if RunVim(before, after)
  
      let lines = readfile('Xtestout')
      let expected = ['Xbefore.vim', 'here.vim', 'foo.vim', 'later.vim', 
'Xafter.vim']
--- 41,47 ----
    call mkdir('Xafter/plugin', 'p')
    call writefile(['let done = 1'], 'Xafter/plugin/later.vim')
  
!   if RunVim(before, after, '')
  
      let lines = readfile('Xtestout')
      let expected = ['Xbefore.vim', 'here.vim', 'foo.vim', 'later.vim', 
'Xafter.vim']
***************
*** 60,62 ****
--- 60,83 ----
    call delete('Xhere', 'rf')
    call delete('Xafter', 'rf')
  endfunc
+ 
+ func Test_help_arg()
+   if RunVim([], [], '--help >Xtestout')
+     let lines = readfile('Xtestout')
+     call assert_true(len(lines) > 20)
+     call assert_true(lines[0] =~ 'Vi IMproved')
+ 
+     " check if  couple of lines are there
+     let found = 0
+     for line in lines
+       if line =~ '-R.*Readonly mode'
+       let found += 1
+       endif
+       if line =~ '--version'
+       let found += 1
+       endif
+     endfor
+     call assert_equal(2, found)
+   endif
+   call delete('Xtestout')
+ endfunc
*** ../vim-7.4.2171/src/testdir/shared.vim      2016-08-06 21:37:23.991218032 
+0200
--- src/testdir/shared.vim      2016-08-06 22:16:29.104745445 +0200
***************
*** 126,146 ****
  " "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)
    if !filereadable('vimcmd')
      return 0
    endif
!   call writefile(a:before, 'Xbefore.vim')
!   call writefile(a:after, 'Xafter.vim')
  
    let cmd = readfile('vimcmd')[0]
    let cmd = substitute(cmd, '-u \f\+', '-u NONE', '')
    if cmd !~ '-u NONE'
      let cmd = cmd . ' -u NONE'
    endif
!   exe "silent !" . cmd . " --cmd \"so Xbefore.vim\" -S Xafter.vim"
  
!   call delete('Xbefore.vim')
!   call delete('Xafter.vim')
    return 1
  endfunc
--- 126,157 ----
  " "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
!   let args = a:arguments
!   if len(a:before) > 0
!     call writefile(a:before, 'Xbefore.vim')
!     let args .= ' --cmd "so Xbefore.vim"'
!   endif
!   if len(a:after) > 0
!     call writefile(a:after, 'Xafter.vim')
!     let args .= ' -S Xafter.vim'
!   endif
  
    let cmd = readfile('vimcmd')[0]
    let cmd = substitute(cmd, '-u \f\+', '-u NONE', '')
    if cmd !~ '-u NONE'
      let cmd = cmd . ' -u NONE'
    endif
!   exe "silent !" . cmd . ' ' . args
  
!   if len(a:before) > 0
!     call delete('Xbefore.vim')
!   endif
!   if len(a:after) > 0
!     call delete('Xafter.vim')
!   endif
    return 1
  endfunc
*** ../vim-7.4.2171/src/version.c       2016-08-06 22:27:24.799508423 +0200
--- src/version.c       2016-08-06 22:28:23.307040939 +0200
***************
*** 765,766 ****
--- 765,768 ----
  {   /* Add new patch number below this line */
+ /**/
+     2172,
  /**/

-- 
I have read and understood the above. X________________

 /// Bram Moolenaar -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui