Discovered that RC comparison was problematic in Akka HTTP

This commit is contained in:
Johan Andrén 2019-10-23 14:56:19 +02:00
parent 87ba57d42e
commit a613661075
2 changed files with 20 additions and 17 deletions

View file

@ -18,6 +18,7 @@ class AkkaVersionSpec extends WordSpec with Matchers {
"succeed if version is RC and ok" in {
AkkaVersion.require("AkkaVersionSpec", "2.5.6", "2.5.7-RC10")
AkkaVersion.require("AkkaVersionSpec", "2.6.0-RC1", "2.6.0-RC1")
}
"fail if version is RC and not ok" in {

View file

@ -29,6 +29,7 @@ object AkkaVersion {
*/
@InternalApi
private[akka] def require(libraryName: String, requiredVersion: String, currentVersion: String): Unit = {
if (requiredVersion != currentVersion) {
val VersionPattern = """(\d+)\.(\d+)\.(\d+)(-(?:M|RC)\d+)?""".r
currentVersion match {
case VersionPattern(currentMajorStr, currentMinorStr, currentPatchStr, mOrRc) =>
@ -49,5 +50,6 @@ object AkkaVersion {
case _ => // SNAPSHOT or unknown - you're on your own
}
}
}
}