Skip to content

Commit

Permalink
Fix resolver bug spotted by property based testing - #1524
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Mar 22, 2016
1 parent 3b4425f commit 807c9eb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Original file line Diff line number Diff line change
@@ -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 #### 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 * 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 * BUGFIX: Fix regression where paket skipped packages with name ending in lib - https://github.com/fsprojects/Paket/issues/1531
Expand Down
3 changes: 2 additions & 1 deletion src/Paket.Core/PackageResolver.fs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -486,7 +486,8 @@ let Resolve(groupName:GroupName, sources, getVersionsF, getPackageDetailsF, glob
when when
(Set.isEmpty conflicts |> not) && (Set.isEmpty conflicts |> not) &&
(conflicts |> Set.exists (fun r -> r = currentRequirement || r.Graph |> List.contains currentRequirement) |> 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 allUnlisted := exploredPackage.Unlisted && !allUnlisted
Expand Down
21 changes: 20 additions & 1 deletion tests/Paket.Tests/Resolver/DependencyGraphSpecs.fs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -121,4 +121,23 @@ let graphWithMissingDependency = [
[<Test>] [<Test>]
let ``should solve graph with missing specific dependency``() = let ``should solve graph with missing specific dependency``() =
let resolved = resolve graphWithMissingDependency ["P44",VersionRange.AtLeast "9.44.25" ] 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.