aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2019-08-20 21:56:57 +0200
committerDaniel Hahler <git@thequod.de>2019-08-22 05:06:30 +0200
commit376d3949816c64f1b1bf499177177f8e8fcfae96 (patch)
tree3467711d4a8f290a8f5518d6f5c078b9d87ccb31
parent356f5fc6e25896137592ab1ba4f1358809c907d6 (diff)
downloadrneovim-376d3949816c64f1b1bf499177177f8e8fcfae96.tar.gz
rneovim-376d3949816c64f1b1bf499177177f8e8fcfae96.tar.bz2
rneovim-376d3949816c64f1b1bf499177177f8e8fcfae96.zip
vim-patch:8.1.1893: script to summarize test results can be improved
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 vim/vim#4845) https://github.com/vim/vim/commit/f1e0544d413b8b2ea129db0655b4e123d54177a6
-rw-r--r--src/nvim/testdir/summarize.vim16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nvim/testdir/summarize.vim b/src/nvim/testdir/summarize.vim
index 69445677d5..4a88935a40 100644
--- a/src/nvim/testdir/summarize.vim
+++ b/src/nvim/testdir/summarize.vim
@@ -1,7 +1,6 @@
-set nocp
if 1
- " This is executed with the eval feature
- set nocp
+ " 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,10 +21,11 @@ if 1
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
+ " 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,7 +37,7 @@ if 1
\ 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: "])