Skip to content

Commit b15c706

Browse files
Merge pull request #556 from rolandtritsch/main
Make sure we support patch versions larger than 9
2 parents 8b0f3cc + 7647440 commit b15c706

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

Diff for: src/main/scala/scoverage/ScoverageSbtPlugin.scala

+4-5
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,13 @@ object ScoverageSbtPlugin extends AutoPlugin {
8989
}
9090

9191
private def isScala3SupportingFilePackageExclusion(scalaVersion: String) = {
92-
def patch = scalaVersion.split('.').drop(2).headOption
92+
def patch = scalaVersion.split('.').map(_.toInt).drop(2).headOption
9393
CrossVersion
9494
.partialVersion(scalaVersion)
9595
.exists {
96-
case (3, minor)
97-
if minor > 4 || (minor == 4 && patch.exists(_ >= "2")) =>
98-
true
99-
case _ => false
96+
case (3, minor) if minor > 4 => true
97+
case (3, minor) if (minor == 4 && patch.exists(_ >= 2)) => true
98+
case _ => false
10099
}
101100
}
102101

Diff for: src/sbt-test/scoverage/scala3-coverage-excluded-files/build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version := "0.1"
22

3-
scalaVersion := "3.4.2"
3+
scalaVersion := "3.5.0"
44

55
libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test
66

Diff for: src/sbt-test/scoverage/scala3-coverage-excluded-files/test

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
> test
55
> coverageReport
66
# There should be no directory for the excluded files
7-
$ exists target/scala-3.4.2/scoverage-report/GoodCoverage.scala.html
8-
-$ exists target/scala-3.4.2/scoverage-report/two
9-
-$ exists target/scala-3.4.2/scoverage-report/three
7+
$ exists target/scala-3.5.0/scoverage-report/GoodCoverage.scala.html
8+
-$ exists target/scala-3.5.0/scoverage-report/two
9+
-$ exists target/scala-3.5.0/scoverage-report/three

0 commit comments

Comments
 (0)