@@ -69,7 +69,7 @@ func Test_help_arg()
6969 if RunVim ([], [], ' --help >Xtestout' )
7070 let lines = readfile (' Xtestout' )
7171 call assert_true (len (lines ) > 20 )
72- call assert_true ( lines [ 0 ] = ~ ' Vi IMproved' )
72+ call assert_match ( ' Vi IMproved' , lines [ 0 ] )
7373
7474 " check if couple of lines are there
7575 let found = 0
@@ -85,3 +85,87 @@ func Test_help_arg()
8585 endif
8686 call delete (' Xtestout' )
8787endfunc
88+
89+ func Test_compatible_args ()
90+ let after = [
91+ \ ' call writefile([string(&compatible)], "Xtestout")' ,
92+ \ ' set viminfo+=nviminfo' ,
93+ \ ' quit' ,
94+ \ ]
95+ if RunVim ([], after, ' -C' )
96+ let lines = readfile (' Xtestout' )
97+ call assert_equal (' 1' , lines [0 ])
98+ endif
99+
100+ if RunVim ([], after, ' -N' )
101+ let lines = readfile (' Xtestout' )
102+ call assert_equal (' 0' , lines [0 ])
103+ endif
104+
105+ call delete (' Xtestout' )
106+ endfunc
107+
108+ func Test_file_args ()
109+ let after = [
110+ \ ' call writefile(argv(), "Xtestout")' ,
111+ \ ' qall' ,
112+ \ ]
113+ if RunVim ([], after, ' ' )
114+ let lines = readfile (' Xtestout' )
115+ call assert_equal (0 , len (lines ))
116+ endif
117+
118+ if RunVim ([], after, ' one' )
119+ let lines = readfile (' Xtestout' )
120+ call assert_equal (1 , len (lines ))
121+ call assert_equal (' one' , lines [0 ])
122+ endif
123+
124+ if RunVim ([], after, ' one two three' )
125+ let lines = readfile (' Xtestout' )
126+ call assert_equal (3 , len (lines ))
127+ call assert_equal (' one' , lines [0 ])
128+ call assert_equal (' two' , lines [1 ])
129+ call assert_equal (' three' , lines [2 ])
130+ endif
131+
132+ if RunVim ([], after, ' one -c echo two' )
133+ let lines = readfile (' Xtestout' )
134+ call assert_equal (2 , len (lines ))
135+ call assert_equal (' one' , lines [0 ])
136+ call assert_equal (' two' , lines [1 ])
137+ endif
138+
139+ if RunVim ([], after, ' one -- -c echo two' )
140+ let lines = readfile (' Xtestout' )
141+ call assert_equal (4 , len (lines ))
142+ call assert_equal (' one' , lines [0 ])
143+ call assert_equal (' -c' , lines [1 ])
144+ call assert_equal (' echo' , lines [2 ])
145+ call assert_equal (' two' , lines [3 ])
146+ endif
147+
148+ call delete (' Xtestout' )
149+ endfunc
150+
151+ func Test_startuptime ()
152+ if ! has (' startuptime' )
153+ return
154+ endif
155+ let after = [' qall' ]
156+ if RunVim ([], after, ' --startuptime Xtestout one' )
157+ let lines = readfile (' Xtestout' )
158+ let expected = [' --- VIM STARTING ---' , ' parsing arguments' ,
159+ \ ' shell init' , ' inits 3' , ' start termcap' , ' opening buffers' ]
160+ let found = []
161+ for line in lines
162+ for exp in expected
163+ if line = ~ exp
164+ call add (found, exp )
165+ endif
166+ endfor
167+ endfor
168+ call assert_equal (expected, found)
169+ endif
170+ call delete (' Xtestout' )
171+ endfunc
0 commit comments