mirror of https://github.com/sbt/sbt.git
Merge pull request #354 from dfxmachina/version-range-bugfix
Fix version interval bug from kinesis producer pom.xml
This commit is contained in:
commit
f0e20106db
|
|
@ -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] =
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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]"
|
||||
|
|
|
|||
Loading…
Reference in New Issue