diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 5c7b09aab9..c1f5cf4e4a 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +#### 2.27.11 - 24.11.2015 +* BUGFIX: Specifying prereleases did not work with pessimistic version constraint - https://github.com/fsprojects/Paket/issues/1252 + #### 2.27.10 - 23.11.2015 * Create installer demo - https://github.com/fsprojects/Paket/issues/1251 diff --git a/src/Paket.Core/VersionRange.fs b/src/Paket.Core/VersionRange.fs index 13d142dab0..7006fb8bf1 100644 --- a/src/Paket.Core/VersionRange.fs +++ b/src/Paket.Core/VersionRange.fs @@ -109,7 +109,7 @@ type VersionRequirement = | VersionRangeBound.Including -> version >= from | VersionRangeBound.Excluding -> version > from - isInLowerBound && isInUpperBound && checkPrerelease prerelease version + (isInLowerBound && isInUpperBound && checkPrerelease prerelease version) || sameVersionWithoutPreRelease from member this.Range = match this with diff --git a/tests/Paket.Tests/DependenciesFile/VersionRangeSpecs.fs b/tests/Paket.Tests/DependenciesFile/VersionRangeSpecs.fs index e3b17e701c..57f643a754 100644 --- a/tests/Paket.Tests/DependenciesFile/VersionRangeSpecs.fs +++ b/tests/Paket.Tests/DependenciesFile/VersionRangeSpecs.fs @@ -22,7 +22,7 @@ let ``can detect specific version``() = [] let ``can detect ordinary Between``() = parseRange "~> 2.2" |> shouldEqual (VersionRange.Between("2.2","3.0")) - parseRange "~> 1.2" |> shouldEqual (VersionRange.Between("1.2","2.0")) + parseRange "~> 1.2" |> shouldEqual (VersionRange.Between("1.2","2.0")) (VersionRequirement(parseRange "~> 1.0",PreReleaseStatus.All)).IsInRange(SemVer.Parse("1.0.071.9556")) |> shouldEqual true (VersionRequirement(parseRange "~> 1.0",PreReleaseStatus.All)).IsInRange(SemVer.Parse("1.0.071.9432")) |> shouldEqual true @@ -30,7 +30,7 @@ let ``can detect ordinary Between``() = let ``can detect lower versions for ~>``() = parseRange "~> 3.2.0.0" |> shouldEqual (VersionRange.Between("3.2.0.0","3.2.1.0")) - parseRange "~> 1.2.3.4" |> shouldEqual (VersionRange.Between("1.2.3.4","1.2.4.0")) + parseRange "~> 1.2.3.4" |> shouldEqual (VersionRange.Between("1.2.3.4","1.2.4.0")) parseRange "~> 1.2.3" |> shouldEqual (VersionRange.Between("1.2.3","1.3.0")) parseRange "~> 1.2" |> shouldEqual (VersionRange.Between("1.2","2.0")) parseRange "~> 1.0" |> shouldEqual (VersionRange.Between("1.0","2.0")) @@ -80,7 +80,7 @@ let ``can detect prereleases``() = [] let ``can detect override operator``() = - parseRange "== 3.2.0.0" |> shouldEqual (VersionRange.OverrideAll(SemVer.Parse "3.2.0.0")) + parseRange "== 3.2.0.0" |> shouldEqual (VersionRange.OverrideAll(SemVer.Parse "3.2.0.0")) [] let ``can detect override operator for beta``() = diff --git a/tests/Paket.Tests/DependenciesFile/VersionRequirementSpecs.fs b/tests/Paket.Tests/DependenciesFile/VersionRequirementSpecs.fs index 8dcb9cc90b..afb22cf8c4 100644 --- a/tests/Paket.Tests/DependenciesFile/VersionRequirementSpecs.fs +++ b/tests/Paket.Tests/DependenciesFile/VersionRequirementSpecs.fs @@ -1,4 +1,4 @@ -module paket.dependenciesFile.VersionRequirementSpecs +module Paket.DependenciesFile.VersionRequirementSpecs open Paket open NUnit.Framework diff --git a/tests/Paket.Tests/FilterVersionSpecs.fs b/tests/Paket.Tests/FilterVersionSpecs.fs index 19c099943e..f769612310 100644 --- a/tests/Paket.Tests/FilterVersionSpecs.fs +++ b/tests/Paket.Tests/FilterVersionSpecs.fs @@ -76,6 +76,11 @@ let ``can check if in range for 4-parts range``() = "1.0.0.3108" |> isInRange (DependenciesFileParser.parseVersionRequirement "1.0.0.3108") |> shouldEqual true "1.0.0.2420" |> isInRange (DependenciesFileParser.parseVersionRequirement "~> 1.0") |> shouldEqual true +[] +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 + [] let ``can support trailing 0``() = "1.2.3" |> isInRange (DependenciesFileParser.parseVersionRequirement "1.2.3.0") |> shouldEqual true diff --git a/tests/Paket.Tests/UpdateProcessSpecs.fs b/tests/Paket.Tests/UpdateProcessSpecs.fs index c7ac7d0278..d333a01a6d 100644 --- a/tests/Paket.Tests/UpdateProcessSpecs.fs +++ b/tests/Paket.Tests/UpdateProcessSpecs.fs @@ -734,7 +734,7 @@ let ``SelectiveUpdate updates package that conflicts with transitive dependency let expected = [("Ninject.Extensions.Interception","0.0.2-alpha001"); ("Ninject.Extensions.Logging","0.0.3"); - ("Ninject", "0.0.3-alpha001")] + ("Ninject", "0.0.2-alpha001")] |> Seq.sortBy fst result