|
| 1 | +package scoverage |
| 2 | + |
| 3 | +import munit.FunSuite |
| 4 | + |
| 5 | +class ScoverageOptionsTest extends FunSuite { |
| 6 | + |
| 7 | + val initalOptions = ScoverageOptions.default() |
| 8 | + val fakeOptions = List( |
| 9 | + "dataDir:myFakeDir", |
| 10 | + "sourceRoot:myFakeSourceRoot", |
| 11 | + "excludedPackages:some.package;another.package*", |
| 12 | + "excludedFiles:*.proto;iHateThisFile.scala", |
| 13 | + "excludedSymbols:someSymbol;anotherSymbol;aThirdSymbol", |
| 14 | + "extraAfterPhase:extarAfter", |
| 15 | + "extraBeforePhase:extraBefore", |
| 16 | + "reportTestName" |
| 17 | + ) |
| 18 | + |
| 19 | + val parsed = ScoverageOptions.parse(fakeOptions, (_) => (), initalOptions) |
| 20 | + |
| 21 | + test("should be able to parse all options") { |
| 22 | + assertEquals( |
| 23 | + parsed.excludedPackages, |
| 24 | + Seq("some.package", "another.package*") |
| 25 | + ) |
| 26 | + assertEquals(parsed.excludedFiles, Seq("*.proto", "iHateThisFile.scala")) |
| 27 | + assertEquals( |
| 28 | + parsed.excludedSymbols, |
| 29 | + Seq("someSymbol", "anotherSymbol", "aThirdSymbol") |
| 30 | + ) |
| 31 | + assertEquals(parsed.dataDir, "myFakeDir") |
| 32 | + assertEquals(parsed.reportTestName, true) |
| 33 | + assertEquals(parsed.sourceRoot, "myFakeSourceRoot") |
| 34 | + } |
| 35 | + |
| 36 | +} |
0 commit comments