Skip to content

Commit

Permalink
Fixed prerelease comparision - fixes #1316
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Jan 7, 2016
1 parent 83711bb commit 9bdf517
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 25 deletions.
26 changes: 3 additions & 23 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,14 @@
#### 2.40.15 - 07.01.2016
#### 2.41.0 - 07.01.2016
* Allow to reference dlls from HTTP resources - https://github.com/fsprojects/Paket/issues/1341
* BUGFIX: Fixed prerelease comparision - https://github.com/fsprojects/Paket/issues/1316

#### 2.40.14 - 07.01.2016
* BUGFIX: Fixed problem with prerelease versions during pack - https://github.com/fsprojects/Paket/issues/1316

#### 2.40.13 - 07.01.2016
* BUGFIX: Do not copy dlls from paket-files - https://github.com/fsprojects/Paket/issues/1341

#### 2.40.11 - 06.01.2016
* BUGFIX: Fixed problem with @ char in paths during pack - https://github.com/fsprojects/Paket/pull/1351

#### 2.40.10 - 06.01.2016
* BUGFIX: Allow to reference dlls from HTTP resources on mono - https://github.com/fsprojects/Paket/pull/1349

#### 2.40.9 - 05.01.2016
* PERFORMANCE: Don't parse lock file in FullUpdate mode
* WORKAROUND: ConfigFile password encryption did not work on specific machines - https://github.com/fsprojects/Paket/pull/1347

#### 2.40.7 - 05.01.2016
* Allow to reference dlls from HTTP resources - https://github.com/fsprojects/Paket/issues/1341

#### 2.40.6 - 05.01.2016
* USABILITY: Show warning when paket.references is used in nupkg content - https://github.com/fsprojects/Paket/issues/1344

#### 2.40.4 - 03.01.2016
* USABILITY: Report group name in download trace - https://github.com/fsprojects/Paket/issues/1337

#### 2.40.3 - 03.01.2016
* PERFORMANCE: Don't parse lock file in FullUpdate mode

#### 2.40.2 - 31.12.2015
* USABILITY: Be more robust against flaky NuGet feeds

#### 2.40.0 - 29.12.2015
Expand Down
4 changes: 2 additions & 2 deletions src/Paket.Core/VersionRange.fs
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ type VersionRequirement =
| Minimum v -> v = version || (v <= version && checkPrerelease prerelease version) || sameVersionWithoutPreRelease v
| GreaterThan v -> v < version && checkPrerelease prerelease version
| Maximum v -> v = version || (v >= version && checkPrerelease prerelease version)
| LessThan v -> v > version && checkPrerelease prerelease version
| LessThan v -> v > version && checkPrerelease prerelease version && not (sameVersionWithoutPreRelease v)
| Range(fromB, from, _to, _toB) ->
let isInUpperBound =
match _toB with
| VersionRangeBound.Including -> version <= _to
| VersionRangeBound.Excluding -> version < _to
| VersionRangeBound.Excluding -> version < _to && not (sameVersionWithoutPreRelease _to)

let isInLowerBound =
match fromB with
Expand Down
12 changes: 12 additions & 0 deletions tests/Paket.Tests/FilterVersionSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ let ``can check if in range for LessThan``() =
"2.0" |> isInRangeNoPreRelease (VersionRange.LessThan (SemVer.Parse "2.2")) |> shouldEqual true
"2.2" |> isInRangeNoPreRelease (VersionRange.LessThan (SemVer.Parse "2.2")) |> shouldEqual false
"3.0" |> isInRangeNoPreRelease (VersionRange.LessThan (SemVer.Parse "2.2")) |> shouldEqual false

[<Test>]
let ``can check if in range for LessThan with prerelease``() =
"3.0.0-alpha1" |> isInRange (DependenciesFileParser.parseVersionRequirement "< 3.0 prerelease") |> shouldEqual false

[<Test>]
let ``can check if in range for Range``() =
Expand Down Expand Up @@ -81,6 +85,14 @@ let ``does include prerelease when twiddle wakka``() =
"1.0.0-alpha002" |> isInRange (DependenciesFileParser.parseVersionRequirement "~> 1.0 alpha") |> shouldEqual true
"1.0" |> isInRange (DependenciesFileParser.parseVersionRequirement "~> 1.0 alpha") |> shouldEqual true

[<Test>]
let ``does not skip version when twiddle wakka``() =
"3.0.0-alpha1" |> isInRange (DependenciesFileParser.parseVersionRequirement "~> 2.0") |> shouldEqual false

[<Test>]
let ``does not skip version when twiddle wakka with prerelease``() =
"3.0.0-alpha1" |> isInRange (DependenciesFileParser.parseVersionRequirement "~> 2.0 prerelease") |> shouldEqual false

[<Test>]
let ``can support trailing 0``() =
"1.2.3" |> isInRange (DependenciesFileParser.parseVersionRequirement "1.2.3.0") |> shouldEqual true
Expand Down

0 comments on commit 9bdf517

Please sign in to comment.