@@ -199,7 +199,7 @@ func Test_o_arg()
199199 " - both windows should have the same height
200200 " - window height (+ 2 for the statusline and Ex command) should be equal
201201 " to the number of lines
202- " - buffer of both windowns should have no name
202+ " - buffer of both windows should have no name
203203 let [wn , wh1, wh2, ln , ww1, ww2, cn, bn1, bn2] = readfile('Xtestout')
204204 call assert_equal (' 2' , wn )
205205 call assert_inrange (0 , 1 , ww1 - ww2)
@@ -225,6 +225,69 @@ func Test_o_arg()
225225 call delete (' Xtestout' )
226226endfunc
227227
228+ " Test the -p[N] argument to open N tabpages.
229+ func Test_p_arg ()
230+ let after = [
231+ \ ' call writefile(split(execute("tabs"), "\n"), "Xtestout")' ,
232+ \ ' qall' ,
233+ \ ]
234+ if RunVim ([], after, ' -p2' )
235+ let lines = readfile (' Xtestout' )
236+ call assert_equal (4 , len (lines ))
237+ call assert_equal (' Tab page 1' , lines [0 ])
238+ call assert_equal (' > [No Name]' , lines [1 ])
239+ call assert_equal (' Tab page 2' , lines [2 ])
240+ call assert_equal (' [No Name]' , lines [3 ])
241+ endif
242+
243+ if RunVim ([], after, ' -p foo bar' )
244+ let lines = readfile (' Xtestout' )
245+ call assert_equal (4 , len (lines ))
246+ call assert_equal (' Tab page 1' , lines [0 ])
247+ call assert_equal (' > foo' , lines [1 ])
248+ call assert_equal (' Tab page 2' , lines [2 ])
249+ call assert_equal (' bar' , lines [3 ])
250+ endif
251+
252+ call delete (' Xtestout' )
253+ endfunc
254+
255+ " Test the -V[N] argument to set the 'version' option to [N]
256+ func Test_V_arg ()
257+ let out = system (GetVimCommand () . ' --clean -es -X -V0 -c "set verbose?" -cq' )
258+ call assert_equal (" verbose=0\n " , out)
259+
260+ let out = system (GetVimCommand () . ' --clean -es -X -V2 -c "set verbose?" -cq' )
261+ call assert_match (" ^sourcing \" $VIMRUNTIME/defaults\. vim\" \r \n Searching for \" filetype\. vim\" .*\n verbose=2\n $" , out)
262+
263+ let out = system (GetVimCommand () . ' --clean -es -X -V15 -c "set verbose?" -cq' )
264+ call assert_match (" \+ *\n sourcing \" $VIMRUNTIME/defaults\. vim\" \r \n line 1: \" The default vimrc file\. .*\n verbose=15\n \+ *" , out)
265+ endfunc
266+
267+ " Test the -A, -F and -H arguments (Arabic, Farsi and Hebrew modes).
268+ func Test_A_F_H_arg ()
269+ let after = [
270+ \ ' call writefile([&rightleft, &arabic, &fkmap, &hkmap], "Xtestout")' ,
271+ \ ' qall' ,
272+ \ ]
273+ if has (' arabic' ) && RunVim ([], after, ' -A' )
274+ let lines = readfile (' Xtestout' )
275+ call assert_equal ([' 1' , ' 1' , ' 0' , ' 0' ], lines )
276+ endif
277+
278+ if has (' farsi' ) && RunVim ([], after, ' -F' )
279+ let lines = readfile (' Xtestout' )
280+ call assert_equal ([' 1' , ' 0' , ' 1' , ' 0' ], lines )
281+ endif
282+
283+ if has (' rightleft' ) && RunVim ([], after, ' -H' )
284+ let lines = readfile (' Xtestout' )
285+ call assert_equal ([' 1' , ' 0' , ' 0' , ' 1' ], lines )
286+ endif
287+
288+ call delete (' Xtestout' )
289+ endfunc
290+
228291func Test_file_args ()
229292 let after = [
230293 \ ' call writefile(argv(), "Xtestout")' ,
0 commit comments