Patch 8.2.1217

5 views
Skip to first unread message

Bram Moolenaar

unread,
Jul 15, 2020, 5:19:50 AM7/15/20
to vim...@googlegroups.com

Patch 8.2.1217
Problem: Startup test depends on random source file.
Solution: Write a test file to find quickfix errors in.
Files: src/testdir/test_startup.vim


*** ../vim-8.2.1216/src/testdir/test_startup.vim 2020-07-15 01:37:32.729753421 +0200
--- src/testdir/test_startup.vim 2020-07-15 11:17:41.526458888 +0200
***************
*** 285,291 ****
func Test_q_arg()
CheckFeature quickfix

! let source_file = has('win32') ? '..\memfile.c' : '../memfile.c'
let after =<< trim [CODE]
call writefile([&errorfile, string(getpos("."))], "Xtestout")
copen
--- 285,299 ----
func Test_q_arg()
CheckFeature quickfix

! 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
***************
*** 295,318 ****

" Test with default argument '-q'.
call assert_equal('errors.err', &errorfile)
! call writefile(["../memfile.c:208:5: error: expected ';' before '}' token"], 'errors.err')
if RunVim([], after, '-q')
let lines = readfile('Xtestout')
call assert_equal(['errors.err',
! \ '[0, 208, 1, 0]',
! \ source_file . "|208 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:208:5: error: expected ';' before '}' token"], 'Xerrors')
if RunVim([], after, '-q Xerrors')
let lines = readfile('Xtestout')
call assert_equal(['Xerrors',
! \ '[0, 208, 1, 0]',
! \ source_file . "|208 col 5| error: expected ';' before '}' token"],
\ lines)
endif
call delete('Xtestout')
--- 303,326 ----

" Test with default argument '-q'.
call assert_equal('errors.err', &errorfile)
! 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, 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(["Xbadfile.c:4:12: error: expected ';' before '}' token"], 'Xerrors')
if RunVim([], after, '-q Xerrors')
let lines = readfile('Xtestout')
call assert_equal(['Xerrors',
! \ '[0, 4, 12, 0]',
! \ "Xbadfile.c|4 col 12| error: expected ';' before '}' token"],
\ lines)
endif
call delete('Xtestout')
***************
*** 321,328 ****
if RunVim([], after, '-qXerrors')
let lines = readfile('Xtestout')
call assert_equal(['Xerrors',
! \ '[0, 208, 1, 0]',
! \ source_file . "|208 col 5| error: expected ';' before '}' token"],
\ lines)
endif

--- 329,336 ----
if RunVim([], after, '-qXerrors')
let lines = readfile('Xtestout')
call assert_equal(['Xerrors',
! \ '[0, 4, 12, 0]',
! \ "Xbadfile.c|4 col 12| error: expected ';' before '}' token"],
\ lines)
endif

***************
*** 330,335 ****
--- 338,344 ----
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
*** ../vim-8.2.1216/src/version.c 2020-07-15 01:37:32.729753421 +0200
--- src/version.c 2020-07-15 11:18:32.466304386 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1217,
/**/

--
How To Keep A Healthy Level Of Insanity:
13. Go to a poetry recital and ask why the poems don't rhyme.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages