use of org.sonar.go.plugin.GoCoverageReport.LineCoverage in project sonar-go by SonarSource.
the class GoCoverageReportTest method line_coverage.
@Test
void line_coverage() {
LineCoverage line = new LineCoverage();
assertThat(line.hits).isEqualTo(0);
line.add(new CoverageStat(2, "main.go:2.2,2.5 1 0"));
assertThat(line.hits).isEqualTo(0);
line.add(new CoverageStat(2, "main.go:2.2,2.5 1 3"));
assertThat(line.hits).isEqualTo(3);
line.add(new CoverageStat(2, "main.go:2.2,2.5 1 2"));
assertThat(line.hits).isEqualTo(5);
line.add(new CoverageStat(2, "main.go:2.8,2.10 1 0"));
assertThat(line.hits).isEqualTo(5);
}
Aggregations