comparison src/testdir/test_startup.vim @ 15284:c31e4b1fa4fd v8.1.0650

patch 8.1.0650: command line argument -q [errorfile] is not tested commit https://github.com/vim/vim/commit/54948183d210f5117271bb5710752da24054fade Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 28 18:32:56 2018 +0100 patch 8.1.0650: command line argument -q [errorfile] is not tested Problem: Command line argument -q [errorfile] is not tested. Solution: Add a test. (Dominique Pelle, closes https://github.com/vim/vim/issues/3730)
author Bram Moolenaar <Bram@vim.org>
date Fri, 28 Dec 2018 18:45:05 +0100
parents 421e120ffb30
children ca0a0b64809c
comparison
equal deleted inserted replaced
15283:719424bd84ec 15284:c31e4b1fa4fd
267 267
268 let out = system(GetVimCommand() . ' --clean -es -X -V15 -c "set verbose?" -cq') 268 let out = system(GetVimCommand() . ' --clean -es -X -V15 -c "set verbose?" -cq')
269 call assert_match("sourcing \"$VIMRUNTIME[\\/]defaults\.vim\"\r\nline 1: \" The default vimrc file\..* verbose=15\n", out) 269 call assert_match("sourcing \"$VIMRUNTIME[\\/]defaults\.vim\"\r\nline 1: \" The default vimrc file\..* verbose=15\n", out)
270 endfunc 270 endfunc
271 271
272 " Test the '-q [errorfile]' argument.
273 func Test_q_arg()
274 let source_file = has('win32') ? '..\memfile.c' : '../memfile.c'
275 let after = [
276 \ 'call writefile([&errorfile, string(getpos("."))], "Xtestout")',
277 \ 'copen',
278 \ 'w >> Xtestout',
279 \ 'qall'
280 \ ]
281
282 " Test with default argument '-q'.
283 call assert_equal('errors.err', &errorfile)
284 call writefile(["../memfile.c:1482:5: error: expected ';' before '}' token"], 'errors.err')
285 if RunVim([], after, '-q')
286 let lines = readfile('Xtestout')
287 call assert_equal(['errors.err',
288 \ '[0, 1482, 5, 0]',
289 \ source_file . "|1482 col 5| error: expected ';' before '}' token"],
290 \ lines)
291 endif
292 call delete('Xtestout')
293 call delete('errors.err')
294
295 " Test with explicit argument '-q Xerrors' (with space).
296 call writefile(["../memfile.c:1482:5: error: expected ';' before '}' token"], 'Xerrors')
297 if RunVim([], after, '-q Xerrors')
298 let lines = readfile('Xtestout')
299 call assert_equal(['Xerrors',
300 \ '[0, 1482, 5, 0]',
301 \ source_file . "|1482 col 5| error: expected ';' before '}' token"],
302 \ lines)
303 endif
304 call delete('Xtestout')
305
306 " Test with explicit argument '-qXerrors' (without space).
307 if RunVim([], after, '-qXerrors')
308 let lines = readfile('Xtestout')
309 call assert_equal(['Xerrors',
310 \ '[0, 1482, 5, 0]',
311 \ source_file . "|1482 col 5| error: expected ';' before '}' token"],
312 \ lines)
313 endif
314
315 call delete('Xtestout')
316 call delete('Xerrors')
317 endfunc
318
272 " Test the -V[N]{filename} argument to set the 'verbose' option to N 319 " Test the -V[N]{filename} argument to set the 'verbose' option to N
273 " and set 'verbosefile' to filename. 320 " and set 'verbosefile' to filename.
274 func Test_V_file_arg() 321 func Test_V_file_arg()
275 if RunVim([], [], ' --clean -V2Xverbosefile -c "set verbose? verbosefile?" -cq') 322 if RunVim([], [], ' --clean -V2Xverbosefile -c "set verbose? verbosefile?" -cq')
276 let out = join(readfile('Xverbosefile'), "\n") 323 let out = join(readfile('Xverbosefile'), "\n")