From 91b1cc0a98e57a66eedb0563b3a0a20321fe64a7 Mon Sep 17 00:00:00 2001 From: wangguoliang Date: Wed, 25 Oct 2017 14:34:02 +0800 Subject: [PATCH] -Fix code coverage error --- engine/report2html.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/report2html.go b/engine/report2html.go index 7f73bc5..ebc70af 100755 --- a/engine/report2html.go +++ b/engine/report2html.go @@ -111,7 +111,7 @@ func (hd *HtmlData) converterCodeTest(structData Reporter) { } codeTestHtmlData.Summary.TotalTime, _ = strconv.ParseFloat(strconv.FormatFloat(totalTime, 'f', 1, 64), 64) codeTestHtmlData.Summary.CodeCover, _ = strconv.ParseFloat(strconv.FormatFloat(result.Percentage, 'f', 1, 64), 64) - codeTestHtmlData.Summary.PackageCover, _ = strconv.ParseFloat(strconv.FormatFloat(float64(len(codeTestHtmlData.Content.Pkg))*1.0/float64(len(codeTestHtmlData.Content.Pkg)+len(codeTestHtmlData.Content.NoTest)), 'f', 1, 64), 64) + codeTestHtmlData.Summary.PackageCover, _ = strconv.ParseFloat(strconv.FormatFloat(100*float64(len(codeTestHtmlData.Content.Pkg))*1.0/float64(len(codeTestHtmlData.Content.Pkg)+len(codeTestHtmlData.Content.NoTest)), 'f', 1, 64), 64) } stringCodeTestJson, err := jsoniter.Marshal(codeTestHtmlData)