Patch 7.4.2177
Problem: No testing for -C and -N command line flags, file arguments,
startuptime.
Solution: Add tests.
Files: src/testdir/test_startup.vim, src/testdir/shared.vim
*** ../vim-7.4.2176/src/testdir/test_startup.vim 2016-08-06
23:03:55.790030629 +0200
--- src/testdir/test_startup.vim 2016-08-07 15:49:40.825485697 +0200
***************
*** 69,75 ****
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
--- 69,75 ----
if RunVim([], [], '--help >Xtestout')
let lines = readfile('Xtestout')
call assert_true(len(lines) > 20)
! call assert_match('Vi IMproved', lines[0])
" check if couple of lines are there
let found = 0
***************
*** 85,87 ****
--- 85,171 ----
endif
call delete('Xtestout')
endfunc
+
+ func Test_compatible_args()
+ let after = [
+ \ 'call writefile([string(&compatible)], "Xtestout")',
+ \ 'set viminfo+=nviminfo',
+ \ 'quit',
+ \ ]
+ if RunVim([], after, '-C')
+ let lines = readfile('Xtestout')
+ call assert_equal('1', lines[0])
+ endif
+
+ if RunVim([], after, '-N')
+ let lines = readfile('Xtestout')
+ call assert_equal('0', lines[0])
+ endif
+
+ call delete('Xtestout')
+ endfunc
+
+ func Test_file_args()
+ let after = [
+ \ 'call writefile(argv(), "Xtestout")',
+ \ 'qall',
+ \ ]
+ if RunVim([], after, '')
+ let lines = readfile('Xtestout')
+ call assert_equal(0, len(lines))
+ endif
+
+ if RunVim([], after, 'one')
+ let lines = readfile('Xtestout')
+ call assert_equal(1, len(lines))
+ call assert_equal('one', lines[0])
+ endif
+
+ if RunVim([], after, 'one two three')
+ let lines = readfile('Xtestout')
+ call assert_equal(3, len(lines))
+ call assert_equal('one', lines[0])
+ call assert_equal('two', lines[1])
+ call assert_equal('three', lines[2])
+ endif
+
+ if RunVim([], after, 'one -c echo two')
+ let lines = readfile('Xtestout')
+ call assert_equal(2, len(lines))
+ call assert_equal('one', lines[0])
+ call assert_equal('two', lines[1])
+ endif
+
+ if RunVim([], after, 'one -- -c echo two')
+ let lines = readfile('Xtestout')
+ call assert_equal(4, len(lines))
+ call assert_equal('one', lines[0])
+ call assert_equal('-c', lines[1])
+ call assert_equal('echo', lines[2])
+ call assert_equal('two', lines[3])
+ endif
+
+ call delete('Xtestout')
+ endfunc
+
+ func Test_startuptime()
+ if !has('startuptime')
+ return
+ endif
+ let after = ['qall']
+ if RunVim([], after, '--startuptime Xtestout one')
+ let lines = readfile('Xtestout')
+ let expected = ['--- VIM STARTING ---', 'parsing arguments',
+ \ 'shell init', 'inits 3', 'start termcap', 'opening buffers']
+ let found = []
+ for line in lines
+ for exp in expected
+ if line =~ exp
+ call add(found, exp)
+ endif
+ endfor
+ endfor
+ call assert_equal(expected, found)
+ endif
+ call delete('Xtestout')
+ endfunc
*** ../vim-7.4.2176/src/testdir/shared.vim 2016-08-06 22:31:38.793479612
+0200
--- src/testdir/shared.vim 2016-08-07 15:38:34.638903350 +0200
***************
*** 130,136 ****
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"'
--- 130,136 ----
if !filereadable('vimcmd')
return 0
endif
! let args = ''
if len(a:before) > 0
call writefile(a:before, 'Xbefore.vim')
let args .= ' --cmd "so Xbefore.vim"'
***************
*** 145,151 ****
if cmd !~ '-u NONE'
let cmd = cmd . ' -u NONE'
endif
! exe "silent !" . cmd . ' ' . args
if len(a:before) > 0
call delete('Xbefore.vim')
--- 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')
*** ../vim-7.4.2176/src/version.c 2016-08-07 15:19:22.204295369 +0200
--- src/version.c 2016-08-07 15:50:43.568976187 +0200
***************
*** 765,766 ****
--- 765,768 ----
{ /* Add new patch number below this line */
+ /**/
+ 2177,
/**/
--
Managers are like cats in a litter box. They instinctively shuffle things
around to conceal what they've done.
(Scott Adams - The Dilbert principle)
/// 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.