Skip to content

Commit bc18bcc

Browse files
committed
fit: diff calculation logic
1 parent 099e1ff commit bc18bcc

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pkg/testcoverage/types.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,17 @@ func calculateStatsDiff(current, base []coverage.Stats) []FileCoverageDiff {
8989
baseSearchMap := coverage.StatsSearchMap(base)
9090

9191
for _, s := range current {
92+
sul := s.UncoveredLines()
93+
if sul == 0 {
94+
continue
95+
}
96+
9297
if b, found := baseSearchMap[s.Name]; found {
93-
if s.UncoveredLines() != b.UncoveredLines() {
98+
if sul != b.UncoveredLines() {
9499
res = append(res, FileCoverageDiff{Current: s, Base: &b})
95100
}
96101
} else {
97-
if s.UncoveredLines() > 0 {
98-
res = append(res, FileCoverageDiff{Current: s})
99-
}
102+
res = append(res, FileCoverageDiff{Current: s})
100103
}
101104
}
102105

0 commit comments

Comments
 (0)