use of com.goide.runconfig.testing.coverage.GoCoverageAnnotator in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoCoverageCalculationTest method testDirectory.
public void testDirectory() throws IOException {
GoCoverageAnnotator annotator = annotate("coverage.go", "coverage2.go", "withoutHits.go");
VirtualFile firstFile = myFixture.findFileInTempDir("coverage.go");
VirtualFile secondFile = myFixture.findFileInTempDir("coverage2.go");
VirtualFile thirdFile = myFixture.findFileInTempDir("withoutHits.go");
assertEquals("75% statements", annotator.getFileCoverageInformationString(firstFile));
assertEquals("83.3% statements", annotator.getFileCoverageInformationString(secondFile));
assertEquals("0% statements", annotator.getFileCoverageInformationString(thirdFile));
assertEquals("66.7% files, 72.7% statements", annotator.getDirCoverageInformationString(firstFile.getParent()));
}
use of com.goide.runconfig.testing.coverage.GoCoverageAnnotator in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoCoverageCalculationTest method annotate.
@NotNull
private GoCoverageAnnotator annotate(@NotNull GoCoverageProjectData data) {
GoCoverageAnnotator annotator = new GoCoverageAnnotator(myFixture.getProject());
annotator.annotateAllFiles(data, getRoot());
return annotator;
}
use of com.goide.runconfig.testing.coverage.GoCoverageAnnotator 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