Patch 8.1.1893

9 views
Skip to first unread message

Bram Moolenaar

unread,
Aug 20, 2019, 3:26:21 PM8/20/19
to vim...@googlegroups.com

Patch 8.1.1893
Problem: Script to summarize test results can be improved.
Solution: Use "silent" for substitute to avoid reporting number of matches.
Remove duplicate "set nocp". (Daniel Hahler, closes #4845)
Files: src/testdir/summarize.vim


*** ../vim-8.1.1892/src/testdir/summarize.vim 2019-06-07 21:29:44.500007647 +0200
--- src/testdir/summarize.vim 2019-08-20 21:24:59.045644422 +0200
***************
*** 1,7 ****
- set nocp
if 1
! " This is executed with the eval feature
! set nocp
func Count(match, type)
if a:type ==# 'executed'
let g:executed += (a:match+0)
--- 1,6 ----
if 1
! " This is executed only with the eval feature
! set nocompatible
func Count(match, type)
if a:type ==# 'executed'
let g:executed += (a:match+0)
***************
*** 22,31 ****

try
" This uses the :s command to just fetch and process the output of the
! " tests, it doesn't acutally replay anything
! %s/^Executed\s\+\zs\d\+\ze\s\+tests/\=Count(submatch(0),'executed')/egn
! %s/^SKIPPED \zs.*/\=Count(submatch(0), 'skipped')/egn
! %s/^\(\d\+\)\s\+FAILED:/\=Count(submatch(1), 'failed')/egn

call extend(output, ["Skipped:"])
call extend(output, skipped_output)
--- 21,31 ----

try
" This uses the :s command to just fetch and process the output of the
! " tests, it doesn't acutally replace anything.
! " And it uses "silent" to avoid reporting the number of matches.
! silent %s/^Executed\s\+\zs\d\+\ze\s\+tests/\=Count(submatch(0),'executed')/egn
! silent %s/^SKIPPED \zs.*/\=Count(submatch(0), 'skipped')/egn
! silent %s/^\(\d\+\)\s\+FAILED:/\=Count(submatch(1), 'failed')/egn

call extend(output, ["Skipped:"])
call extend(output, skipped_output)
***************
*** 37,43 ****
\ printf(" Skipped: %5d Tests", g:skipped),
\ printf(" %s: %5d Tests", g:failed == 0 ? 'Failed' : 'FAILED', g:failed),
\ "",
! \ ])
if filereadable('test.log')
" outputs and indents the failed test result
call extend(output, ["", "Failures: "])
--- 37,43 ----
\ printf(" Skipped: %5d Tests", g:skipped),
\ printf(" %s: %5d Tests", g:failed == 0 ? 'Failed' : 'FAILED', g:failed),
\ "",
! \ ])
if filereadable('test.log')
" outputs and indents the failed test result
call extend(output, ["", "Failures: "])
*** ../vim-8.1.1892/src/version.c 2019-08-20 21:11:43.180949125 +0200
--- src/version.c 2019-08-20 21:22:44.986677574 +0200
***************
*** 767,768 ****
--- 767,770 ----
{ /* Add new patch number below this line */
+ /**/
+ 1893,
/**/

--
From "know your smileys":
=):-) Uncle Sam

/// 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