diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-11-21 22:19:12 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-11-21 22:28:26 -0500 |
commit | c4cef4ec93e3a6c9b9842239ae80cf90e528d559 (patch) | |
tree | d7663a80957293dda83e5bbd77fa400e36988613 | |
parent | 74eed35f959e74a9a7015295cdd0a9a21bab0456 (diff) | |
download | rneovim-c4cef4ec93e3a6c9b9842239ae80cf90e528d559.tar.gz rneovim-c4cef4ec93e3a6c9b9842239ae80cf90e528d559.tar.bz2 rneovim-c4cef4ec93e3a6c9b9842239ae80cf90e528d559.zip |
vim-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 vim/vim#3730)
https://github.com/vim/vim/commit/54948183d210f5117271bb5710752da24054fade
-rw-r--r-- | src/nvim/testdir/test_startup.vim | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_startup.vim b/src/nvim/testdir/test_startup.vim index 12bec745a8..ec043a3188 100644 --- a/src/nvim/testdir/test_startup.vim +++ b/src/nvim/testdir/test_startup.vim @@ -278,6 +278,53 @@ func Test_V_arg() " call assert_match("sourcing \"$VIMRUNTIME[\\/]defaults\.vim\"\r\nline 1: \" The default vimrc file\..* verbose=15\n", out) endfunc +" Test the '-q [errorfile]' argument. +func Test_q_arg() + let source_file = has('win32') ? '..\memfile.c' : '../memfile.c' + let after = [ + \ 'call writefile([&errorfile, string(getpos("."))], "Xtestout")', + \ 'copen', + \ 'w >> Xtestout', + \ 'qall' + \ ] + + " Test with default argument '-q'. + call assert_equal('errors.err', &errorfile) + call writefile(["../memfile.c:1482:5: error: expected ';' before '}' token"], 'errors.err') + if RunVim([], after, '-q') + let lines = readfile('Xtestout') + call assert_equal(['errors.err', + \ '[0, 1482, 5, 0]', + \ source_file . "|1482 col 5| error: expected ';' before '}' token"], + \ lines) + endif + call delete('Xtestout') + call delete('errors.err') + + " Test with explicit argument '-q Xerrors' (with space). + call writefile(["../memfile.c:1482:5: error: expected ';' before '}' token"], 'Xerrors') + if RunVim([], after, '-q Xerrors') + let lines = readfile('Xtestout') + call assert_equal(['Xerrors', + \ '[0, 1482, 5, 0]', + \ source_file . "|1482 col 5| error: expected ';' before '}' token"], + \ lines) + endif + call delete('Xtestout') + + " Test with explicit argument '-qXerrors' (without space). + if RunVim([], after, '-qXerrors') + let lines = readfile('Xtestout') + call assert_equal(['Xerrors', + \ '[0, 1482, 5, 0]', + \ source_file . "|1482 col 5| error: expected ';' before '}' token"], + \ lines) + endif + + call delete('Xtestout') + call delete('Xerrors') +endfunc + " Test the -V[N]{filename} argument to set the 'verbose' option to N " and set 'verbosefile' to filename. func Test_V_file_arg() |