From 4c14410af63a6fdcdda085e920e0b54b06f45932 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 21 Nov 2020 22:40:47 -0500 Subject: vim-patch:8.2.1217: startup test depends on random source file Problem: Startup test depends on random source file. Solution: Write a test file to find quickfix errors in. https://github.com/vim/vim/commit/1e1f612bd42085becb2208b9a95ed3ed0d272ee8 N/A patches for version.c: vim-patch:8.2.1216: startup test fails Problem: Startup test fails. Solution: Adjust expected values for deleted lines. https://github.com/vim/vim/commit/b6e4e4c6f7b4f7eadcc4c2397bfa57e0734e005f --- src/nvim/testdir/test_startup.vim | 39 ++++++++++++++++++++++++--------------- 1 file 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 -- cgit