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