test/old: cherry-pick patch 8.1.2373 for test_startup.vim

This commit is contained in:
Jan Edmund Lazo
2020-11-21 22:36:45 -05:00
parent c4cef4ec93
commit e632e30b8a

View File

@@ -2,6 +2,7 @@
source shared.vim
source screendump.vim
source check.vim
" Check that loading startup.vim works.
func Test_startup_script()
@@ -280,6 +281,8 @@ endfunc
" Test the '-q [errorfile]' argument.
func Test_q_arg()
CheckFeature quickfix
let source_file = has('win32') ? '..\memfile.c' : '../memfile.c'
let after = [
\ 'call writefile([&errorfile, string(getpos("."))], "Xtestout")',
@@ -455,6 +458,7 @@ func Test_invalid_args()
let out = split(system(GetVimCommand() .. ' - xxx -cq'), "\n")
call assert_equal(0, v:shell_error)
if has('quickfix')
" Detect invalid repeated arguments '-t foo -t foo", '-q foo -q foo'.
for opt in ['-t', '-q']
let out = split(system(GetVimCommand() .. repeat(' ' .. opt .. ' foo', 2)), "\n")
@@ -462,6 +466,7 @@ func Test_invalid_args()
call assert_equal('nvim: Too many edit arguments: "' .. opt .. '"', out[0])
call assert_equal('More info with "nvim -h"', out[1])
endfor
endif
for opt in [' -cq', ' --cmd q', ' +', ' -S foo']
let out = split(system(GetVimCommand() .. repeat(opt, 11)), "\n")