Skip to content
This repository was archived by the owner on Dec 3, 2020. It is now read-only.

Commit fca37e3

Browse files
author
Daniel Reigada
committed
Add test for invalid format
1 parent e784fc1 commit fca37e3

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/test/resources/invalid_report.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<coverageReport>
2+
<files>
3+
<file name="test.scala">
4+
<lines>
5+
<line id="2">3</line>
6+
</lines>
7+
</file>
8+
</files>
9+
</coverageReport>

src/test/scala/com/codacy/parsers/CoverageParserFactoryTest.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ class CoverageParserFactoryTest extends WordSpec with BeforeAndAfterAll with Mat
2828
runForFile("src/test/resources/test_jacoco.xml", Some(JacocoParser)) shouldEqual Right(expectedReport)
2929
}
3030

31+
"fail to get invalid report" in {
32+
runForFile("invalid_report.xml", None) shouldEqual
33+
Left("could not parse report, unrecognized report format")
34+
}
3135

3236
"fail to get report with wrong parser" in {
3337
runForFile("src/test/resources/test_jacoco.xml", Some(CoberturaParser)) shouldEqual

0 commit comments

Comments
 (0)