From 5e715b63c5ec5171c3c82e4c3ea946d3c18890c5 Mon Sep 17 00:00:00 2001 From: John Roberts Date: Mon, 7 Nov 2011 17:47:34 -0800 Subject: [PATCH] Modified the cover() function to correctly cound SLOC lines. Previously, it was only counting lines that were hit exactly once. Modified to count lines >=1 and SLOC, and ==0 for missing. --- bin/expresso | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/expresso b/bin/expresso index 4e9e900..9b242fd 100755 --- a/bin/expresso +++ b/bin/expresso @@ -706,7 +706,7 @@ function populateCoverage(cov) { function coverage(data, val) { var n = 0; for (var i = 0, len = data.length; i < len; ++i) { - if (data[i] !== undefined && data[i] == val) ++n; + if (data[i] !== undefined && val ? data[i] >= 1 : data[i]==0) ++n; } return n; }