-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Selective update should only update dependent packages #410
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
module Paket.LockFile.QuerySpecs | ||
|
||
open Paket | ||
open NUnit.Framework | ||
open FsUnit | ||
open TestHelpers | ||
open Paket.Domain | ||
|
||
let data = """NUGET | ||
remote: https://nuget.org/api/v2 | ||
specs: | ||
Castle.Windsor (2.1) | ||
Castle.Windsor-log4net (3.3) | ||
Castle.Windsor (>= 2.0) | ||
log4net (>= 1.0) | ||
Rx-Core (2.1) | ||
Rx-Main (2.0) | ||
Rx-Core (>= 2.1) | ||
log (1.2) | ||
log4net (1.1) | ||
log (>= 1.0) | ||
GITHUB | ||
remote: fsharp/FAKE | ||
specs: | ||
src/app/FAKE/Cli.fs (7699e40e335f3cc54ab382a8969253fecc1e08a9) | ||
src/app/Fake.Deploy.Lib/FakeDeployAgentHelper.fs (Globbing) | ||
""" | ||
|
||
let lockFile = LockFile.Parse("Test",toLines data) | ||
|
||
|
||
[<Test>] | ||
let ``should detect itself as dependency``() = | ||
lockFile.IsDependencyOf(PackageName "Rx-Core",PackageName "Rx-Core") | ||
|> shouldEqual true | ||
|
||
[<Test>] | ||
let ``should detect direct dependencies``() = | ||
lockFile.IsDependencyOf(PackageName "Rx-Core",PackageName "Rx-Main") | ||
|> shouldEqual true | ||
|
||
[<Test>] | ||
let ``should detect indirect dependencies``() = | ||
lockFile.IsDependencyOf(PackageName "log",PackageName "Castle.Windsor-log4net") | ||
|> shouldEqual true | ||
|
||
[<Test>] | ||
let ``should detect when packages are unrelated``() = | ||
lockFile.IsDependencyOf(PackageName "log",PackageName "Rx-Core") | ||
|> shouldEqual false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@forki You could refactor it further to use an accumulator parameter, than we can call
addPackage package (HashSet<_>())
and remove thisusedPackages
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same logic is here - maybe could be reused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes please send PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do