-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Improved parsing of non-canonical PURL (package-url/purl-spec#363) - Improved "URI::VersionRange->constraint_contains" - Updated "maven" repository URL - FIX typo in documentation - Synced "test-suite-data.json" from "package-url/purl-spec"
- Loading branch information
1 parent
473798c
commit 49879e8
Showing
11 changed files
with
141 additions
and
38 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
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
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 |
---|---|---|
|
@@ -7,10 +7,11 @@ use Test::More; | |
|
||
use URI::PackageURL; | ||
|
||
my $t1 = 'pkg:cpan/GDT/URI-PackageURL@2.00'; | ||
my $t1 = 'pkg:cpan/GDT/URI-PackageURL@2.22'; | ||
my $t2 = 'pkg:deb/debian/[email protected]?arch=i386&distro=jessie'; | ||
my $t3 = 'pkg:golang/google.golang.org/genproto@abcdedf#googleapis/api/annotations'; | ||
my $t4 = 'pkg:docker/customer/dockerimage@sha256:244fd47e07d1004f0aed9c?repository_url=gcr.io'; | ||
my $t5 = 'pkg:generic/ns/n@m#?@version?qualifier=#v@lue#subp@th?'; | ||
|
||
subtest "Decode '$t1'" => sub { | ||
|
||
|
@@ -19,7 +20,7 @@ subtest "Decode '$t1'" => sub { | |
is($purl->type, 'cpan', 'Type'); | ||
is($purl->namespace, 'GDT', 'Namespace'); | ||
is($purl->name, 'URI-PackageURL', 'Name'); | ||
is($purl->version, '2.00', 'Version'); | ||
is($purl->version, '2.22', 'Version'); | ||
|
||
is($purl->to_string, $t1, 'PackageURL'); | ||
|
||
|
@@ -69,4 +70,17 @@ subtest "Decode '$t4'" => sub { | |
|
||
}; | ||
|
||
subtest "Decode '$t5'" => sub { | ||
|
||
my $purl = decode_purl($t5); | ||
|
||
is($purl->type, 'generic', 'Type'); | ||
is($purl->namespace, 'ns', 'Namespace'); | ||
is($purl->name, 'n@m#?', 'Name'); | ||
is($purl->version, 'version', 'Version'); | ||
is($purl->qualifiers->{qualifier}, '#v@lue', 'Qualifier "qualifier"'); | ||
is($purl->subpath, 'subp@th?', 'Subpath'); | ||
|
||
}; | ||
|
||
done_testing(); |
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 |
---|---|---|
|
@@ -60,7 +60,8 @@ my @tests = ( | |
{ | ||
purl => 'pkg:maven/org.apache.xmlgraphics/[email protected]?packaging=sources', | ||
repository_url => 'https://mvnrepository.com/artifact/org.apache.xmlgraphics/batik-anim/1.9.1', | ||
download_url => 'https://repo1.maven.org/maven2/org/apache/xmlgraphics/batik-anim/1.9.1/batik-anim-1.9.1.jar' | ||
download_url => | ||
'https://repo.maven.apache.org/maven2/org/apache/xmlgraphics/batik-anim/1.9.1/batik-anim-1.9.1.jar' | ||
}, | ||
|
||
{purl => 'pkg:pypi/[email protected]', repository_url => 'https://pypi.org/project/django/1.11.1'}, | ||
|
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 |
---|---|---|
|
@@ -550,5 +550,77 @@ | |
"qualifiers": null, | ||
"subpath": null, | ||
"is_invalid": false | ||
}, | ||
{ | ||
"description": "cpan distribution name are case sensitive", | ||
"purl": "pkg:cpan/DROLSKY/[email protected]", | ||
"canonical_purl": "pkg:cpan/DROLSKY/[email protected]", | ||
"type": "cpan", | ||
"namespace": "DROLSKY", | ||
"name": "DateTime", | ||
"version": "1.55", | ||
"qualifiers": null, | ||
"subpath": null, | ||
"is_invalid": false | ||
}, | ||
{ | ||
"description": "cpan module name are case sensitive", | ||
"purl": "pkg:cpan/URI::[email protected]", | ||
"canonical_purl": "pkg:cpan/URI::[email protected]", | ||
"type": "cpan", | ||
"namespace": null, | ||
"name": "URI::PackageURL", | ||
"version": "2.11", | ||
"qualifiers": null, | ||
"subpath": null, | ||
"is_invalid": false | ||
}, | ||
{ | ||
"description": "cpan module name like distribution name", | ||
"purl": "pkg:cpan/[email protected]", | ||
"canonical_purl": "pkg:cpan/[email protected]", | ||
"type": "cpan", | ||
"namespace": null, | ||
"name": "Perl-Version", | ||
"version": "1.013", | ||
"qualifiers": null, | ||
"subpath": null, | ||
"is_invalid": true | ||
}, | ||
{ | ||
"description": "cpan distribution name like module name", | ||
"purl": "pkg:cpan/GDT/URI::[email protected]", | ||
"canonical_purl": "pkg:cpan/GDT/URI::PackageURL", | ||
"type": "cpan", | ||
"namespace": "GDT", | ||
"name": "URI::PackageURL", | ||
"version": null, | ||
"qualifiers": null, | ||
"subpath": null, | ||
"is_invalid": true | ||
}, | ||
{ | ||
"description": "cpan valid module name", | ||
"purl": "pkg:cpan/[email protected]", | ||
"canonical_purl": "pkg:cpan/[email protected]", | ||
"type": "cpan", | ||
"namespace": null, | ||
"name": "DateTime", | ||
"version": "1.55", | ||
"qualifiers": null, | ||
"subpath": null, | ||
"is_invalid": false | ||
}, | ||
{ | ||
"description": "cpan valid module name without version", | ||
"purl": "pkg:cpan/URI", | ||
"canonical_purl": "pkg:cpan/URI", | ||
"type": "cpan", | ||
"namespace": null, | ||
"name": "URI", | ||
"version": null, | ||
"qualifiers": null, | ||
"subpath": null, | ||
"is_invalid": false | ||
} | ||
] |