Search in sources :

Example 1 with LineCoverage

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);
}
Also used : CoverageStat(org.sonar.go.plugin.GoCoverageReport.CoverageStat) LineCoverage(org.sonar.go.plugin.GoCoverageReport.LineCoverage) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 CoverageStat (org.sonar.go.plugin.GoCoverageReport.CoverageStat)1 LineCoverage (org.sonar.go.plugin.GoCoverageReport.LineCoverage)1