-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a6082d
commit c5e63af
Showing
5 changed files
with
44 additions
and
12 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -255,6 +255,7 @@ Supported package management tools: | |
- Go | ||
- Maven | ||
- NuGet | ||
- .NET | ||
- npm | ||
- Pip | ||
- Pipenv | ||
|
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 |
---|---|---|
|
@@ -571,3 +571,30 @@ func uniquePackageManagerChecks(t *testing.T, test dependencyFixTest) { | |
default: | ||
} | ||
} | ||
|
||
func TestGetFixedPackage(t *testing.T) { | ||
var testcases = []struct { | ||
impactedPackage string | ||
versionOperator string | ||
suggestedFixedVersion string | ||
expectedOutput []string | ||
}{ | ||
{ | ||
impactedPackage: "snappier", | ||
versionOperator: " -v ", | ||
suggestedFixedVersion: "1.1.1", | ||
expectedOutput: []string{"snappier", "-v", "1.1.1"}, | ||
}, | ||
{ | ||
impactedPackage: "json", | ||
versionOperator: "@", | ||
suggestedFixedVersion: "10.0.0", | ||
expectedOutput: []string{"[email protected]"}, | ||
}, | ||
} | ||
|
||
for _, test := range testcases { | ||
fixedPackageArgs := getFixedPackage(test.impactedPackage, test.versionOperator, test.suggestedFixedVersion) | ||
assert.Equal(t, test.expectedOutput, fixedPackageArgs) | ||
} | ||
} |
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