aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/cover/report_test.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/pkg/cover/report_test.go b/pkg/cover/report_test.go
index 54eb44937..caafa2d39 100644
--- a/pkg/cover/report_test.go
+++ b/pkg/cover/report_test.go
@@ -201,9 +201,16 @@ func checkCSVReport(t *testing.T, CSVReport []byte) {
t.Fatalf("heading line in CSV doesn't match %v", lines[0])
}
+ foundMain := false
for _, line := range lines {
- if line[1] == "main" && line[2] != "1" && line[3] != "1" {
- t.Fatalf("function coverage percentage doesn't match %v vs. %v", line[2], "100")
+ if line[1] == "main" {
+ foundMain = true
+ if line[2] != "1" && line[3] != "1" {
+ t.Fatalf("function coverage percentage doesn't match %v vs. %v", line[2], "100")
+ }
}
}
+ if !foundMain {
+ t.Fatalf("no main in the CSV report")
+ }
}