summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-12-28 18:32:56 +0100
committerBram Moolenaar <Bram@vim.org>2018-12-28 18:32:56 +0100
commit54948183d210f5117271bb5710752da24054fade (patch)
tree608e73ab074fb6e9a6baf927e13e3535032c6317
parentb7a7e039b4362ac9e35b37896e7a736bd4c35e2c (diff)
patch 8.1.0650: command line argument -q [errorfile] is not testedv8.1.0650
Problem: Command line argument -q [errorfile] is not tested. Solution: Add a test. (Dominique Pelle, closes #3730)
-rw-r--r--src/testdir/test_startup.vim47
-rw-r--r--src/version.c2
2 files changed, 49 insertions, 0 deletions
diff --git a/src/testdir/test_startup.vim b/src/testdir/test_startup.vim
index 6f06ab877e..16b202f85c 100644
--- a/src/testdir/test_startup.vim
+++ b/src/testdir/test_startup.vim
@@ -269,6 +269,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()
diff --git a/src/version.c b/src/version.c
index 870ea896de..cbb0e70eae 100644
--- a/src/version.c
+++ b/src/version.c
@@ -800,6 +800,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 650,
+/**/
649,
/**/
648,