Merge pull request #354 from dfxmachina/version-range-bugfix

Fix version interval bug from kinesis producer pom.xml
This commit is contained in:
Alexandre Archambault 2016-10-04 19:55:52 +02:00 committed by GitHub
commit f0e20106db
3 changed files with 9 additions and 4 deletions

View File

@ -6,8 +6,9 @@ import coursier.core.compatibility._
object Parse {
def version(s: String): Option[Version] = {
if (s.isEmpty || s.exists(c => c != '.' && c != '-' && c != '_' && !c.letterOrDigit)) None
else Some(Version(s))
val trimmed = s.trim
if (trimmed.isEmpty || trimmed.exists(c => c != '.' && c != '-' && c != '_' && !c.letterOrDigit)) None
else Some(Version(trimmed))
}
def ivyLatestSubRevisionInterval(s: String): Option[VersionInterval] =

View File

@ -1,3 +1,3 @@
org.webjars.bower:jquery:3.1.0:compile
org.webjars.bower:jquery:3.1.1:compile
org.webjars.bower:jquery-mousewheel:3.1.13:compile
org.webjars.bower:malihu-custom-scrollbar-plugin:3.1.5:compile

View File

@ -133,7 +133,7 @@ object VersionIntervalTests extends TestSuite {
'basic{
val itv = Parse.versionInterval("[2.2,)").get
assert(!itv.contains(v21))
assert(itv.contains(v22))
assert(itv.contains(v23))
@ -195,6 +195,10 @@ object VersionIntervalTests extends TestSuite {
val s4 = "(1.1,1.3)"
val itv4 = Parse.versionInterval(s4)
assert(itv4 == Some(VersionInterval(Some(Version("1.1")), Some(Version("1.3")), false, false)))
val s5 = "(1.11.0, 1.12.0]"
val itv5 = Parse.versionInterval(s5)
assert(itv5 == Some(VersionInterval(Some(Version("1.11.0")), Some(Version("1.12.0")), false, true)))
}
'leftEmptyVersions {
val s1 = "[,1.3]"