use of com.goide.runconfig.testing.coverage.GoCoverageProjectData in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoCoverageCalculationTest method parseData.
@NotNull
private GoCoverageProjectData parseData(@NotNull String coverageSource) throws IOException {
try (BufferedReader reader = new BufferedReader(new FileReader(new File(getTestDataPath(), coverageSource)))) {
GoCoverageProjectData data = GoCoverageRunner.parseCoverage(reader, myFixture.getProject(), myModule);
assertNotNull(data);
return data;
}
}
use of com.goide.runconfig.testing.coverage.GoCoverageProjectData in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoCoverageCalculationTest method testMerging.
public void testMerging() throws IOException {
VirtualFile file = myFixture.getTempDirFixture().createFile(file());
GoCoverageProjectData firstData = parseData("coverage.out");
GoCoverageProjectData secondData = parseData("coverage_for_merge.out");
GoCoverageAnnotator firstAnnotator = annotate(firstData);
GoCoverageAnnotator secondAnnotator = annotate(secondData);
firstData.merge(secondData);
GoCoverageAnnotator mergeAnnotator = annotate(firstData);
assertEquals("75% statements", firstAnnotator.getFileCoverageInformationString(file));
assertEquals("33.3% statements", secondAnnotator.getFileCoverageInformationString(file));
assertEquals("80% statements", mergeAnnotator.getFileCoverageInformationString(file));
}
Aggregations