aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/testdir/test_startup.vim39
1 files changed, 24 insertions, 15 deletions
diff --git a/src/nvim/testdir/test_startup.vim b/src/nvim/testdir/test_startup.vim
index 747eb28a28..7fe0168356 100644
--- a/src/nvim/testdir/test_startup.vim
+++ b/src/nvim/testdir/test_startup.vim
@@ -284,34 +284,42 @@ endfunc
func Test_q_arg()
CheckFeature quickfix
- let source_file = has('win32') ? '..\memfile.c' : '../memfile.c'
- let after = [
- \ 'call writefile([&errorfile, string(getpos("."))], "Xtestout")',
- \ 'copen',
- \ 'w >> Xtestout',
- \ 'qall'
- \ ]
+ let lines =<< trim END
+ /* some file with an error */
+ main() {
+ functionCall(arg; arg, arg);
+ return 666
+ }
+ END
+ call writefile(lines, 'Xbadfile.c')
+
+ let after =<< trim [CODE]
+ call writefile([&errorfile, string(getpos("."))], "Xtestout")
+ copen
+ w >> Xtestout
+ qall
+ [CODE]
" Test with default argument '-q'.
call assert_equal('errors.err', &errorfile)
- call writefile(["../memfile.c:1482:5: error: expected ';' before '}' token"], 'errors.err')
+ call writefile(["Xbadfile.c:4:12: 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"],
+ \ '[0, 4, 12, 0]',
+ \ "Xbadfile.c|4 col 12| 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')
+ call writefile(["Xbadfile.c:4:12: 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"],
+ \ '[0, 4, 12, 0]',
+ \ "Xbadfile.c|4 col 12| error: expected ';' before '}' token"],
\ lines)
endif
call delete('Xtestout')
@@ -320,8 +328,8 @@ func Test_q_arg()
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"],
+ \ '[0, 4, 12, 0]',
+ \ "Xbadfile.c|4 col 12| error: expected ';' before '}' token"],
\ lines)
endif
@@ -329,6 +337,7 @@ func Test_q_arg()
let out = system(GetVimCommand() .. ' -q xyz.err')
call assert_equal(3, v:shell_error)
+ call delete('Xbadfile.c')
call delete('Xtestout')
call delete('Xerrors')
endfunc