Skip to content

Commit

Permalink
Additional badge testcase where not all platform editions are supported
Browse files Browse the repository at this point in the history
Prompted by #660 (comment),
this is a testcase for when Scala platform editions are not available for
all cited Scala versions. In this situation, there are a few options for
what the badge text could be:

* Over promise: `7.1.0 (Scala 3.0.0-M3, 2.13 - Native 0.4+0.3)`, which
  incorrectly implies that there's a `3.0.0-M3` version for `Native 0.4`.
* Provide full detail:
  `7.1.0 (Scala 3.0.0-M3 - Native 0.4, Scala 2.13 - Native 0.3)`.
* Omit platform versions that don't have full support for the listed
  Scala language versions: `7.1.0 (Scala 3.0.0-M3, 2.13)`.

The endpoint `latest-by-scala-version.svg`, is intended to list all
supported Scala versions, with the latest artifact version against them,
and giving that information concisely takes priority over providing
completely comprehensive information about the differing versions of the
Scala platforms. It's also best not to over-promise, so of the three
options I think the last is the best.
  • Loading branch information
rtyley authored and adpi2 committed May 11, 2021
1 parent 6e77626 commit f2e519e
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,17 @@ class ArtifactScalaVersionSupportTest extends FunSpec with Matchers {

}

it(
"should not list Scala platform editions that are not supported by all cited versions of the Scala language"
) {
ArtifactScalaVersionSupport(
Map(
`7.1.0` -> Seq(
ScalaNative(`2.13`, Native.`0.3`),
ScalaNative(`3.0.0-M3`, Native.`0.4`),
)
)
).summaryOfLatestArtifactsSupportingScalaVersions shouldBe "7.1.0 (Scala 3.0.0-M3, 2.13)"
}

}

0 comments on commit f2e519e

Please sign in to comment.