From 1bb5a1a185fc849c4398e2d4bb6eed922450330e Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 25 May 2018 02:10:56 +0200 Subject: [PATCH] coverage#CreateReport: move assertions up (#23) This makes it easier in case of errors to see where it is coming from. --- autoload/coverage.vim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/autoload/coverage.vim b/autoload/coverage.vim index 6f04050..df08311 100644 --- a/autoload/coverage.vim +++ b/autoload/coverage.vim @@ -166,10 +166,13 @@ function! coverage#CreateReport(covered, uncovered, partial, ...) abort if a:0 > 0 let l:extra_dict = maktaba#ensure#IsDict(a:1) endif + call maktaba#ensure#IsList(a:covered) + call maktaba#ensure#IsList(a:uncovered) + call maktaba#ensure#IsList(a:partial) return extend(l:extra_dict, - \ {'covered': maktaba#ensure#IsList(a:covered), - \ 'uncovered': maktaba#ensure#IsList(a:uncovered), - \ 'partial': maktaba#ensure#IsList(a:partial)}) + \ {'covered': a:covered, + \ 'uncovered': a:uncovered, + \ 'partial': a:partial}) endfunction