Permalink
Browse files

Fix resolver bug spotted by property based testing - #1524

  • Loading branch information...
1 parent 3b4425f commit 807c9eb52e157b1f6cade70e7aae79c90dd33054 @forki forki committed Mar 22, 2016
Showing with 25 additions and 2 deletions.
  1. +3 −0 RELEASE_NOTES.md
  2. +2 −1 src/Paket.Core/PackageResolver.fs
  3. +20 −1 tests/Paket.Tests/Resolver/DependencyGraphSpecs.fs
View
@@ -1,3 +1,6 @@
+#### 2.55.0-alpha001 - 22.03.2016
+* Fix resolver bug spotted by property based testing - https://github.com/fsprojects/Paket/issues/1524
+
#### 2.54.0 - 21.03.2016
* It's possible to influence the CopyToOutputDirectory property for content references in project files - http://fsprojects.github.io/Paket/nuget-dependencies.html#CopyToOutputDirectory-settings
* BUGFIX: Fix regression where paket skipped packages with name ending in lib - https://github.com/fsprojects/Paket/issues/1531
@@ -486,7 +486,8 @@ let Resolve(groupName:GroupName, sources, getVersionsF, getPackageDetailsF, glob
when
(Set.isEmpty conflicts |> not) &&
(conflicts |> Set.exists (fun r -> r = currentRequirement || r.Graph |> List.contains currentRequirement) |> not) ->
- forceBreak := true
+ if getConflicts(filteredVersions,closedRequirements,openRequirements,currentRequirement) |> Set.isEmpty |> not then
+ forceBreak := true
| _ -> ()
allUnlisted := exploredPackage.Unlisted && !allUnlisted
@@ -121,4 +121,23 @@ let graphWithMissingDependency = [
[<Test>]
let ``should solve graph with missing specific dependency``() =
let resolved = resolve graphWithMissingDependency ["P44",VersionRange.AtLeast "9.44.25" ]
- getVersion resolved.[PackageName "P44"] |> shouldEqual "9.44.25"
+ getVersion resolved.[PackageName "P44"] |> shouldEqual "9.44.25"
+
+
+
+
+[<Test>]
+let ``should solve strange graph``() =
+ let graph = [
+ "P1","10.11.11", ["P7", VersionRequirement (VersionRange.AtMost "4.2.11.10",PreReleaseStatus.No)]
+ "P3","1.1.3", ["P8", VersionRequirement (VersionRange.AtMost "0.2.8",PreReleaseStatus.No)]
+ "P3","5.5.7.9", ["P1", VersionRequirement (VersionRange.AtMost "10.11.11",PreReleaseStatus.No)]
+ "P7","4.2.11.10", []
+ "P7","10.3.5.7", []
+ "P7","11.10.10.3", []
+ ]
+
+ let resolved = resolve graph ["P3",VersionRange.AtLeast "0"; "P7",VersionRange.AtMost "11.10.10.3"]
+ getVersion resolved.[PackageName "P1"] |> shouldEqual "10.11.11"
+ getVersion resolved.[PackageName "P3"] |> shouldEqual "5.5.7.9"
+ getVersion resolved.[PackageName "P7"] |> shouldEqual "4.2.11.10"

0 comments on commit 807c9eb

Please sign in to comment.