Skip to content

Commit

Permalink
Do not create double prerelease identifiers - fixes #1099
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Sep 29, 2015
1 parent e32f68f commit 030eabc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#### 2.5.0-alpha002 - 29.09.2015
#### 2.5.0 - 29.09.2015
* Remove all Paket entries from projects which have no paket.references - https://github.com/fsprojects/Paket/issues/1097
* Allow to format VersionRequirements in NuGet syntax
* BUGFIX: Fix KeyNotFoundException when project is net4.0-client - https://github.com/fsprojects/Paket/issues/1095
* BUGFIX: Put prerelease requirement into NuSpec during paket pack - https://github.com/fsprojects/Paket/issues/1088
* BUGFIX: Inconsistent framework exclusion in paket.dependencies - https://github.com/fsprojects/Paket/issues/1093
* BUGFIX: Commands add/remove stripped link:false from file references - https://github.com/fsprojects/Paket/issues/1089
* BUGFIX: Do not create double prerelease identifiers - https://github.com/fsprojects/Paket/issues/1099
* COSMETICS: Only fixup dates in zip archive under Mono - https://github.com/fsprojects/Paket/pull/1094
* PERFORMANCE: Skip asking for versions if only a specific version is requested
* PERFORMANCE: Check if a feed supports a protocol and never retry if not - https://github.com/fsprojects/Paket/issues/1085
Expand Down
4 changes: 3 additions & 1 deletion src/Paket.Core/VersionRange.fs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ type VersionRequirement =
| Concrete [x] -> "-" + x
| _ -> "-prerelease"

let normalize (v:SemVerInfo) = v.Normalize() + pre
let normalize (v:SemVerInfo) =
let s = v.Normalize()
if s.Contains("-") then s else s + pre

let str =
match range with
Expand Down
13 changes: 13 additions & 0 deletions tests/Paket.Tests/DependenciesFile/VersionRequirementSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ let ``can parse twiddle-wakka with prerelease``() =
req.FormatInNuGetSyntax()
|> shouldEqual "[6.0.0-prerelease,6.1.0-prerelease)"

[<Test>]
let ``can parse doubled prerelease``() =
let req = DependenciesFileParser.parseVersionRequirement "0.33.0-beta prerelease"

req
|> shouldEqual
(VersionRequirement.VersionRequirement(
VersionRange.Specific(SemVer.Parse("0.33.0-beta")),
PreReleaseStatus.All))

req.FormatInNuGetSyntax()
|> shouldEqual "[0.33.0-beta]"

[<Test>]
let ``can order simple at least requirements in package requirement``() =
require "A" ResolverStrategy.Max ">= 2.2" |> shouldBeGreaterThan (require "A" ResolverStrategy.Max ">= 2.3")
Expand Down

0 comments on commit 030eabc

Please sign in to comment.