xref: /vim-8.2.3635/src/testdir/test_startup.vim (revision 2e693a88)
1" Tests for startup.
2
3source shared.vim
4source screendump.vim
5source check.vim
6
7" Check that loading startup.vim works.
8func Test_startup_script()
9  set compatible
10  source $VIMRUNTIME/defaults.vim
11
12  call assert_equal(0, &compatible)
13endfunc
14
15" Verify the order in which plugins are loaded:
16" 1. plugins in non-after directories
17" 2. packages
18" 3. plugins in after directories
19func Test_after_comes_later()
20  if !has('packages')
21    return
22  endif
23  let before =<< trim [CODE]
24    set nocp viminfo+=nviminfo
25    set guioptions+=M
26    let $HOME = "/does/not/exist"
27    set loadplugins
28    set rtp=Xhere,Xafter,Xanother
29    set packpath=Xhere,Xafter
30    set nomore
31    let g:sequence = ""
32  [CODE]
33
34  let after =<< trim [CODE]
35    redir! > Xtestout
36    scriptnames
37    redir END
38    redir! > Xsequence
39    echo g:sequence
40    redir END
41    quit
42  [CODE]
43
44  call mkdir('Xhere/plugin', 'p')
45  call writefile(['let g:sequence .= "here "'], 'Xhere/plugin/here.vim')
46  call mkdir('Xanother/plugin', 'p')
47  call writefile(['let g:sequence .= "another "'], 'Xanother/plugin/another.vim')
48  call mkdir('Xhere/pack/foo/start/foobar/plugin', 'p')
49  call writefile(['let g:sequence .= "pack "'], 'Xhere/pack/foo/start/foobar/plugin/foo.vim')
50
51  call mkdir('Xafter/plugin', 'p')
52  call writefile(['let g:sequence .= "after "'], 'Xafter/plugin/later.vim')
53
54  if RunVim(before, after, '')
55
56    let lines = readfile('Xtestout')
57    let expected = ['Xbefore.vim', 'here.vim', 'another.vim', 'foo.vim', 'later.vim', 'Xafter.vim']
58    let found = []
59    for line in lines
60      for one in expected
61	if line =~ one
62	  call add(found, one)
63	endif
64      endfor
65    endfor
66    call assert_equal(expected, found)
67  endif
68
69  call assert_equal('here another pack after', substitute(join(readfile('Xsequence', 1), ''), '\s\+$', '', ''))
70
71  call delete('Xtestout')
72  call delete('Xsequence')
73  call delete('Xhere', 'rf')
74  call delete('Xanother', 'rf')
75  call delete('Xafter', 'rf')
76endfunc
77
78func Test_pack_in_rtp_when_plugins_run()
79  if !has('packages')
80    return
81  endif
82  let before =<< trim [CODE]
83    set nocp viminfo+=nviminfo
84    set guioptions+=M
85    let $HOME = "/does/not/exist"
86    set loadplugins
87    set rtp=Xhere
88    set packpath=Xhere
89    set nomore
90  [CODE]
91
92  let after = [
93	\ 'quit',
94	\ ]
95  call mkdir('Xhere/plugin', 'p')
96  call writefile(['redir! > Xtestout', 'silent set runtimepath?', 'silent! call foo#Trigger()', 'redir END'], 'Xhere/plugin/here.vim')
97  call mkdir('Xhere/pack/foo/start/foobar/autoload', 'p')
98  call writefile(['function! foo#Trigger()', 'echo "autoloaded foo"', 'endfunction'], 'Xhere/pack/foo/start/foobar/autoload/foo.vim')
99
100  if RunVim(before, after, '')
101
102    let lines = filter(readfile('Xtestout'), '!empty(v:val)')
103    call assert_match('Xhere[/\\]pack[/\\]foo[/\\]start[/\\]foobar', get(lines, 0))
104    call assert_match('autoloaded foo', get(lines, 1))
105  endif
106
107  call delete('Xtestout')
108  call delete('Xhere', 'rf')
109endfunc
110
111func Test_help_arg()
112  if !has('unix') && has('gui')
113    " this doesn't work with gvim on MS-Windows
114    return
115  endif
116  if RunVim([], [], '--help >Xtestout')
117    let lines = readfile('Xtestout')
118    call assert_true(len(lines) > 20)
119    call assert_match('Vi IMproved', lines[0])
120
121    " check if  couple of lines are there
122    let found = []
123    for line in lines
124      if line =~ '-R.*Readonly mode'
125	call add(found, 'Readonly mode')
126      endif
127      " Watch out for a second --version line in the Gnome version.
128      if line =~ '--version.*Print version information and exit'
129	call add(found, "--version")
130      endif
131    endfor
132    call assert_equal(['Readonly mode', '--version'], found)
133  endif
134  call delete('Xtestout')
135endfunc
136
137func Test_compatible_args()
138  let after =<< trim [CODE]
139    call writefile([string(&compatible)], "Xtestout")
140    set viminfo+=nviminfo
141    quit
142  [CODE]
143
144  if RunVim([], after, '-C')
145    let lines = readfile('Xtestout')
146    call assert_equal('1', lines[0])
147  endif
148
149  if RunVim([], after, '-N')
150    let lines = readfile('Xtestout')
151    call assert_equal('0', lines[0])
152  endif
153
154  call delete('Xtestout')
155endfunc
156
157" Test the -o[N] and -O[N] arguments to open N windows split
158" horizontally or vertically.
159func Test_o_arg()
160  let after =<< trim [CODE]
161    set cpo&vim
162    call writefile([winnr("$"),
163		\ winheight(1), winheight(2), &lines,
164		\ winwidth(1), winwidth(2), &columns,
165		\ bufname(winbufnr(1)), bufname(winbufnr(2))],
166		\ "Xtestout")
167    qall
168  [CODE]
169
170  if RunVim([], after, '-o2')
171    " Open 2 windows split horizontally. Expect:
172    " - 2 windows
173    " - both windows should have the same or almost the same height
174    " - sum of both windows height (+ 3 for both statusline and Ex command)
175    "   should be equal to the number of lines
176    " - both windows should have the same width which should be equal to the
177    "   number of columns
178    " - buffer of both windows should have no name
179    let [wn, wh1, wh2, ln, ww1, ww2, cn, bn1, bn2] = readfile('Xtestout')
180    call assert_equal('2', wn)
181    call assert_inrange(0, 1, wh1 - wh2)
182    call assert_equal(string(wh1 + wh2 + 3), ln)
183    call assert_equal(ww1, ww2)
184    call assert_equal(ww1, cn)
185    call assert_equal('', bn1)
186    call assert_equal('', bn2)
187  endif
188
189  if RunVim([], after, '-o foo bar')
190    " Same expectations as for -o2 but buffer names should be foo and bar
191    let [wn, wh1, wh2, ln, ww1, ww2, cn, bn1, bn2] = readfile('Xtestout')
192    call assert_equal('2', wn)
193    call assert_inrange(0, 1, wh1 - wh2)
194    call assert_equal(string(wh1 + wh2 + 3), ln)
195    call assert_equal(ww1, ww2)
196    call assert_equal(ww1, cn)
197    call assert_equal('foo', bn1)
198    call assert_equal('bar', bn2)
199  endif
200
201  if RunVim([], after, '-O2')
202    " Open 2 windows split vertically. Expect:
203    " - 2 windows
204    " - both windows should have the same or almost the same width
205    " - sum of both windows width (+ 1 for the separator) should be equal to
206    "   the number of columns
207    " - both windows should have the same height
208    " - window height (+ 2 for the statusline and Ex command) should be equal
209    "   to the number of lines
210    " - buffer of both windows should have no name
211    let [wn, wh1, wh2, ln, ww1, ww2, cn, bn1, bn2] = readfile('Xtestout')
212    call assert_equal('2', wn)
213    call assert_inrange(0, 1, ww1 - ww2)
214    call assert_equal(string(ww1 + ww2 + 1), cn)
215    call assert_equal(wh1, wh2)
216    call assert_equal(string(wh1 + 2), ln)
217    call assert_equal('', bn1)
218    call assert_equal('', bn2)
219  endif
220
221  if RunVim([], after, '-O foo bar')
222    " Same expectations as for -O2 but buffer names should be foo and bar
223    let [wn, wh1, wh2, ln, ww1, ww2, cn, bn1, bn2] = readfile('Xtestout')
224    call assert_equal('2', wn)
225    call assert_inrange(0, 1, ww1 - ww2)
226    call assert_equal(string(ww1 + ww2 + 1), cn)
227    call assert_equal(wh1, wh2)
228    call assert_equal(string(wh1 + 2), ln)
229    call assert_equal('foo', bn1)
230    call assert_equal('bar', bn2)
231  endif
232
233  call delete('Xtestout')
234endfunc
235
236" Test the -p[N] argument to open N tabpages.
237func Test_p_arg()
238  let after =<< trim [CODE]
239    call writefile(split(execute("tabs"), "\n"), "Xtestout")
240    qall
241  [CODE]
242
243  if RunVim([], after, '-p2')
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('>   [No Name]', lines[1])
248    call assert_equal('Tab page 2',    lines[2])
249    call assert_equal('    [No Name]', lines[3])
250  endif
251
252  if RunVim([], after, '-p foo bar')
253    let lines = readfile('Xtestout')
254    call assert_equal(4, len(lines))
255    call assert_equal('Tab page 1', lines[0])
256    call assert_equal('>   foo',    lines[1])
257    call assert_equal('Tab page 2', lines[2])
258    call assert_equal('    bar',    lines[3])
259  endif
260
261  call delete('Xtestout')
262endfunc
263
264" Test the -V[N] argument to set the 'verbose' option to [N]
265func Test_V_arg()
266  " Can't catch the output of gvim.
267  CheckNotGui
268
269  let out = system(GetVimCommand() . ' --clean -es -X -V0 -c "set verbose?" -cq')
270  call assert_equal("  verbose=0\n", out)
271
272  let out = system(GetVimCommand() . ' --clean -es -X -V2 -c "set verbose?" -cq')
273  call assert_match("sourcing \"$VIMRUNTIME[\\/]defaults\.vim\"\r\nSearching for \"filetype\.vim\".*\n", out)
274  call assert_match("  verbose=2\n", out)
275
276  let out = system(GetVimCommand() . ' --clean -es -X -V15 -c "set verbose?" -cq')
277   call assert_match("sourcing \"$VIMRUNTIME[\\/]defaults\.vim\"\r\nline 1: \" The default vimrc file\..*  verbose=15\n", out)
278endfunc
279
280" Test the '-q [errorfile]' argument.
281func Test_q_arg()
282  let source_file = has('win32') ? '..\memfile.c' : '../memfile.c'
283  let after =<< trim [CODE]
284    call writefile([&errorfile, string(getpos("."))], "Xtestout")
285    copen
286    w >> Xtestout
287    qall
288  [CODE]
289
290  " Test with default argument '-q'.
291  call assert_equal('errors.err', &errorfile)
292  call writefile(["../memfile.c:208:5: error: expected ';' before '}' token"], 'errors.err')
293  if RunVim([], after, '-q')
294    let lines = readfile('Xtestout')
295    call assert_equal(['errors.err',
296	\              '[0, 208, 5, 0]',
297	\              source_file . "|208 col 5| error: expected ';' before '}' token"],
298	\             lines)
299  endif
300  call delete('Xtestout')
301  call delete('errors.err')
302
303  " Test with explicit argument '-q Xerrors' (with space).
304  call writefile(["../memfile.c:208:5: error: expected ';' before '}' token"], 'Xerrors')
305  if RunVim([], after, '-q Xerrors')
306    let lines = readfile('Xtestout')
307    call assert_equal(['Xerrors',
308	\              '[0, 208, 5, 0]',
309	\              source_file . "|208 col 5| error: expected ';' before '}' token"],
310	\             lines)
311  endif
312  call delete('Xtestout')
313
314  " Test with explicit argument '-qXerrors' (without space).
315  if RunVim([], after, '-qXerrors')
316    let lines = readfile('Xtestout')
317    call assert_equal(['Xerrors',
318	\              '[0, 208, 5, 0]',
319	\              source_file . "|208 col 5| error: expected ';' before '}' token"],
320	\             lines)
321  endif
322
323  call delete('Xtestout')
324  call delete('Xerrors')
325endfunc
326
327" Test the -V[N]{filename} argument to set the 'verbose' option to N
328" and set 'verbosefile' to filename.
329func Test_V_file_arg()
330  if RunVim([], [], ' --clean -V2Xverbosefile -c "set verbose? verbosefile?" -cq')
331    let out = join(readfile('Xverbosefile'), "\n")
332    call assert_match("sourcing \"$VIMRUNTIME[\\/]defaults\.vim\"\n", out)
333    call assert_match("\n  verbose=2\n", out)
334    call assert_match("\n  verbosefile=Xverbosefile", out)
335  endif
336
337  call delete('Xverbosefile')
338endfunc
339
340" Test the -m, -M and -R arguments:
341" -m resets 'write'
342" -M resets 'modifiable' and 'write'
343" -R sets 'readonly'
344func Test_m_M_R()
345  let after =<< trim [CODE]
346    call writefile([&write, &modifiable, &readonly, &updatecount], "Xtestout")
347    qall
348  [CODE]
349
350  if RunVim([], after, '')
351    let lines = readfile('Xtestout')
352    call assert_equal(['1', '1', '0', '200'], lines)
353  endif
354  if RunVim([], after, '-m')
355    let lines = readfile('Xtestout')
356    call assert_equal(['0', '1', '0', '200'], lines)
357  endif
358  if RunVim([], after, '-M')
359    let lines = readfile('Xtestout')
360    call assert_equal(['0', '0', '0', '200'], lines)
361  endif
362  if RunVim([], after, '-R')
363    let lines = readfile('Xtestout')
364    call assert_equal(['1', '1', '1', '10000'], lines)
365  endif
366
367  call delete('Xtestout')
368endfunc
369
370" Test the -A, -F and -H arguments (Arabic, Farsi and Hebrew modes).
371func Test_A_F_H_arg()
372  let after =<< trim [CODE]
373    call writefile([&rightleft, &arabic, &fkmap, &hkmap], "Xtestout")
374    qall
375  [CODE]
376
377  " Use silent Ex mode to avoid the hit-Enter prompt for the warning that
378  " 'encoding' is not utf-8.
379  if has('arabic') && &encoding == 'utf-8' && RunVim([], after, '-e -s -A')
380    let lines = readfile('Xtestout')
381    call assert_equal(['1', '1', '0', '0'], lines)
382  endif
383
384  if has('farsi') && RunVim([], after, '-F')
385    let lines = readfile('Xtestout')
386    call assert_equal(['1', '0', '1', '0'], lines)
387  endif
388
389  if has('rightleft') && RunVim([], after, '-H')
390    let lines = readfile('Xtestout')
391    call assert_equal(['1', '0', '0', '1'], lines)
392  endif
393
394  call delete('Xtestout')
395endfunc
396
397func Test_invalid_args()
398  " must be able to get the output of Vim.
399  CheckUnix
400  CheckNotGui
401
402  for opt in ['-Y', '--does-not-exist']
403    let out = split(system(GetVimCommand() .. ' ' .. opt), "\n")
404    call assert_equal(1, v:shell_error)
405    call assert_match('^VIM - Vi IMproved .* (.*)$',              out[0])
406    call assert_equal('Unknown option argument: "' .. opt .. '"', out[1])
407    call assert_equal('More info with: "vim -h"',                 out[2])
408  endfor
409
410  for opt in ['-c', '-i', '-s', '-t', '-T', '-u', '-U', '-w', '-W', '--cmd', '--startuptime']
411    let out = split(system(GetVimCommand() .. ' '  .. opt), "\n")
412    call assert_equal(1, v:shell_error)
413    call assert_match('^VIM - Vi IMproved .* (.*)$',             out[0])
414    call assert_equal('Argument missing after: "' .. opt .. '"', out[1])
415    call assert_equal('More info with: "vim -h"',                out[2])
416  endfor
417
418  if has('clientserver')
419    for opt in ['--remote', '--remote-send', '--remote-silent', '--remote-expr',
420          \     '--remote-tab', '--remote-tab-wait',
421          \     '--remote-tab-wait-silent', '--remote-tab-silent',
422          \     '--remote-wait', '--remote-wait-silent',
423          \     '--servername',
424          \    ]
425      let out = split(system(GetVimCommand() .. ' '  .. opt), "\n")
426      call assert_equal(1, v:shell_error)
427      call assert_match('^VIM - Vi IMproved .* (.*)$',             out[0])
428      call assert_equal('Argument missing after: "' .. opt .. '"', out[1])
429      call assert_equal('More info with: "vim -h"',                out[2])
430    endfor
431  endif
432
433  if has('gui_gtk')
434    let out = split(system(GetVimCommand() .. ' --display'), "\n")
435    call assert_equal(1, v:shell_error)
436    call assert_match('^VIM - Vi IMproved .* (.*)$',         out[0])
437    call assert_equal('Argument missing after: "--display"', out[1])
438    call assert_equal('More info with: "vim -h"',            out[2])
439  endif
440
441  if has('xterm_clipboard')
442    let out = split(system(GetVimCommand() .. ' -display'), "\n")
443    call assert_equal(1, v:shell_error)
444    call assert_match('^VIM - Vi IMproved .* (.*)$',         out[0])
445    call assert_equal('Argument missing after: "-display"', out[1])
446    call assert_equal('More info with: "vim -h"',            out[2])
447  endif
448
449  let out = split(system(GetVimCommand() .. ' -ix'), "\n")
450  call assert_equal(1, v:shell_error)
451  call assert_match('^VIM - Vi IMproved .* (.*)$',          out[0])
452  call assert_equal('Garbage after option argument: "-ix"', out[1])
453  call assert_equal('More info with: "vim -h"',             out[2])
454
455  let out = split(system(GetVimCommand() .. ' - xxx'), "\n")
456  call assert_equal(1, v:shell_error)
457  call assert_match('^VIM - Vi IMproved .* (.*)$',    out[0])
458  call assert_equal('Too many edit arguments: "xxx"', out[1])
459  call assert_equal('More info with: "vim -h"',       out[2])
460
461  " Detect invalid repeated arguments '-t foo -t foo", '-q foo -q foo'.
462  for opt in ['-t', '-q']
463    let out = split(system(GetVimCommand() .. repeat(' ' .. opt .. ' foo', 2)), "\n")
464    call assert_equal(1, v:shell_error)
465    call assert_match('^VIM - Vi IMproved .* (.*)$',              out[0])
466    call assert_equal('Too many edit arguments: "' .. opt .. '"', out[1])
467    call assert_equal('More info with: "vim -h"',                 out[2])
468  endfor
469
470  for opt in [' -cq', ' --cmd q', ' +', ' -S foo']
471    let out = split(system(GetVimCommand() .. repeat(opt, 11)), "\n")
472    call assert_equal(1, v:shell_error)
473    " FIXME: The error message given by Vim is not ideal in case of repeated
474    " -S foo since it does not mention -S.
475    call assert_match('^VIM - Vi IMproved .* (.*)$',                                    out[0])
476    call assert_equal('Too many "+command", "-c command" or "--cmd command" arguments', out[1])
477    call assert_equal('More info with: "vim -h"',                                       out[2])
478  endfor
479
480  if has('gui_gtk')
481    for opt in ['--socketid x', '--socketid 0xg']
482      let out = split(system(GetVimCommand() .. ' ' .. opt), "\n")
483      call assert_equal(1, v:shell_error)
484      call assert_match('^VIM - Vi IMproved .* (.*)$',        out[0])
485      call assert_equal('Invalid argument for: "--socketid"', out[1])
486      call assert_equal('More info with: "vim -h"',           out[2])
487    endfor
488  endif
489endfunc
490
491func Test_file_args()
492  let after =<< trim [CODE]
493    call writefile(argv(), "Xtestout")
494    qall
495  [CODE]
496
497  if RunVim([], after, '')
498    let lines = readfile('Xtestout')
499    call assert_equal(0, len(lines))
500  endif
501
502  if RunVim([], after, 'one')
503    let lines = readfile('Xtestout')
504    call assert_equal(1, len(lines))
505    call assert_equal('one', lines[0])
506  endif
507
508  if RunVim([], after, 'one two three')
509    let lines = readfile('Xtestout')
510    call assert_equal(3, len(lines))
511    call assert_equal('one', lines[0])
512    call assert_equal('two', lines[1])
513    call assert_equal('three', lines[2])
514  endif
515
516  if RunVim([], after, 'one -c echo two')
517    let lines = readfile('Xtestout')
518    call assert_equal(2, len(lines))
519    call assert_equal('one', lines[0])
520    call assert_equal('two', lines[1])
521  endif
522
523  if RunVim([], after, 'one -- -c echo two')
524    let lines = readfile('Xtestout')
525    call assert_equal(4, len(lines))
526    call assert_equal('one', lines[0])
527    call assert_equal('-c', lines[1])
528    call assert_equal('echo', lines[2])
529    call assert_equal('two', lines[3])
530  endif
531
532  call delete('Xtestout')
533endfunc
534
535func Test_startuptime()
536  if !has('startuptime')
537    return
538  endif
539  let after = ['qall']
540  if RunVim([], after, '--startuptime Xtestout one')
541    let lines = readfile('Xtestout')
542    let expected = ['--- VIM STARTING ---', 'parsing arguments',
543	  \ 'shell init', 'inits 3', 'start termcap', 'opening buffers']
544    let found = []
545    for line in lines
546      for exp in expected
547	if line =~ exp
548	  call add(found, exp)
549	endif
550      endfor
551    endfor
552    call assert_equal(expected, found)
553  endif
554  call delete('Xtestout')
555endfunc
556
557func Test_read_stdin()
558  let after =<< trim [CODE]
559    write Xtestout
560    quit!
561  [CODE]
562
563  if RunVimPiped([], after, '-', 'echo something | ')
564    let lines = readfile('Xtestout')
565    " MS-Windows adds a space after the word
566    call assert_equal(['something'], split(lines[0]))
567  endif
568  call delete('Xtestout')
569endfunc
570
571func Test_set_shell()
572  let after =<< trim [CODE]
573    call writefile([&shell], "Xtestout")
574    quit!
575  [CODE]
576
577  if has('win32')
578    let $SHELL = 'C:\with space\cmd.exe'
579    let expected = '"C:\with space\cmd.exe"'
580  else
581    let $SHELL = '/bin/with space/sh'
582    let expected = '/bin/with\ space/sh'
583  endif
584
585  if RunVimPiped([], after, '', '')
586    let lines = readfile('Xtestout')
587    call assert_equal(expected, lines[0])
588  endif
589  call delete('Xtestout')
590endfunc
591
592func Test_progpath()
593  " Tests normally run with "./vim" or "../vim", these must have been expanded
594  " to a full path.
595  if has('unix')
596    call assert_equal('/', v:progpath[0])
597  elseif has('win32')
598    call assert_equal(':', v:progpath[1])
599    call assert_match('[/\\]', v:progpath[2])
600  endif
601
602  " Only expect "vim" to appear in v:progname.
603  call assert_match('vim\c', v:progname)
604endfunc
605
606func Test_silent_ex_mode()
607  " must be able to get the output of Vim.
608  CheckUnix
609  CheckNotGui
610
611  " This caused an ml_get error.
612  let out = system(GetVimCommand() . '-u NONE -es -c''set verbose=1|h|exe "%norm\<c-y>\<c-d>"'' -c cq')
613  call assert_notmatch('E315:', out)
614endfunc
615
616func Test_default_term()
617  " must be able to get the output of Vim.
618  CheckUnix
619  CheckNotGui
620
621  let save_term = $TERM
622  let $TERM = 'unknownxxx'
623  let out = system(GetVimCommand() . ' -c''set term'' -c cq')
624  call assert_match("defaulting to 'ansi'", out)
625  let $TERM = save_term
626endfunc
627
628func Test_zzz_startinsert()
629  " Test :startinsert
630  call writefile(['123456'], 'Xtestout')
631  let after =<< trim [CODE]
632    :startinsert
633    call feedkeys("foobar\<c-o>:wq\<cr>","t")
634  [CODE]
635
636  if RunVim([], after, 'Xtestout')
637    let lines = readfile('Xtestout')
638    call assert_equal(['foobar123456'], lines)
639  endif
640  " Test :startinsert!
641  call writefile(['123456'], 'Xtestout')
642  let after =<< trim [CODE]
643    :startinsert!
644    call feedkeys("foobar\<c-o>:wq\<cr>","t")
645  [CODE]
646
647  if RunVim([], after, 'Xtestout')
648    let lines = readfile('Xtestout')
649    call assert_equal(['123456foobar'], lines)
650  endif
651  call delete('Xtestout')
652endfunc
653
654func Test_issue_3969()
655  " Can't catch the output of gvim.
656  CheckNotGui
657
658  " Check that message is not truncated.
659  let out = system(GetVimCommand() . ' -es -X -V1 -c "echon ''hello''" -cq')
660  call assert_equal('hello', out)
661endfunc
662
663func Test_start_with_tabs()
664  if !CanRunVimInTerminal()
665    throw 'Skipped: cannot make screendumps'
666  endif
667
668  let buf = RunVimInTerminal('-p a b c', {})
669  call VerifyScreenDump(buf, 'Test_start_with_tabs', {})
670
671  " clean up
672  call StopVimInTerminal(buf)
673endfunc
674