-
Notifications
You must be signed in to change notification settings - Fork 20
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
e762d1f
commit 4e33b08
Showing
3 changed files
with
28 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 |
---|---|---|
|
@@ -20,4 +20,7 @@ dist | |
# Dependency directories (remove the comment below to include it) | ||
# vendor/ | ||
|
||
# IDE configs | ||
.idea | ||
|
||
/parlay |
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 |
---|---|---|
|
@@ -111,6 +111,20 @@ func TestPurlToEcosystemsName(t *testing.T) { | |
purlStr: "pkg:maven/my-artifact", | ||
expectedName: "my-artifact", | ||
}, | ||
{ | ||
// Test case 5: When the package manager type is "golang" | ||
// and the namespace is not empty, the function should return | ||
// a string in the form of "<namespace>/<name>" | ||
purlStr: "pkg:golang/example.com/foo/[email protected]", | ||
expectedName: "example.com/foo/bar", | ||
}, | ||
{ | ||
// Test case 6: When the package manager type is "golang" | ||
// and the namespace has lots of weird characters, make sure | ||
// they get filtered properly | ||
purlStr: "pkg:golang/example.com/f.o_o/ba~r", | ||
expectedName: "example.com/f.o_o/ba~r", | ||
}, | ||
} | ||
|
||
for _, testCase := range testCases { | ||
|