Skip to content

Commit

Permalink
Added handling for [2.2,) version ranges.
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierzwirtz committed Nov 11, 2015
1 parent f6e92c3 commit ac40c17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Paket.Core/VersionRange.fs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ type VersionRequirement =
match fromB, toB with
| VersionRangeBound.Excluding, VersionRangeBound.Excluding -> GreaterThan(versions.[0])
| VersionRangeBound.Including, VersionRangeBound.Including -> Minimum(versions.[0])
| VersionRangeBound.Including, VersionRangeBound.Excluding -> Minimum(versions.[0])
| _ -> failParse()
| _ -> failParse()

Expand Down
4 changes: 3 additions & 1 deletion tests/Paket.Tests/NugetVersionRangeParserSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ let ``can detect range version``() =

[<Test>]
let ``can detect open range version``() =
parseRange "[2.2,)"
|> shouldEqual (VersionRange.Minimum (SemVer.Parse "2.2"))
parseRange "[2.2,]"
|> shouldEqual (VersionRange.Minimum (SemVer.Parse "2.2"))
parseRange "[2.2, ]"
|> shouldEqual (VersionRange.Minimum (SemVer.Parse "2.2"))
parseRange "[,2.2]"
|> shouldEqual (VersionRange.Maximum (SemVer.Parse "2.2"))

[<Test>]
let ``can detect "null" version``() =
VersionRequirement.Parse "null"
Expand Down

0 comments on commit ac40c17

Please sign in to comment.