Skip to content

Commit 3734822

Browse files
authored
Merge pull request #587 from TG1999/sort_qualifiers_in_spec
Fix purl-spec testcases
2 parents 414fef4 + fe2ca3a commit 3734822

File tree

8 files changed

+38
-38
lines changed

8 files changed

+38
-38
lines changed

tests/types/cocoapods-test.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@
142142
},
143143
{
144144
"description": "Rountrip test for <class 'type'> PURL",
145-
"test_group": "base",
145+
"test_group": "advanced",
146146
"test_type": "roundtrip",
147147
"input": "pkg:cocoapods/[email protected]#NSData+zlib",
148-
"expected_output": "pkg:cocoapods/[email protected]#NSData+zlib",
148+
"expected_output": "pkg:cocoapods/[email protected]#NSData%2Bzlib",
149149
"expected_failure": false,
150150
"expected_failure_reason": null
151151
},
@@ -161,7 +161,7 @@
161161
"qualifiers": null,
162162
"subpath": "NSData+zlib"
163163
},
164-
"expected_output": "pkg:cocoapods/[email protected]#NSData+zlib",
164+
"expected_output": "pkg:cocoapods/[email protected]#NSData%2Bzlib",
165165
"expected_failure": false,
166166
"expected_failure_reason": null
167167
}

tests/types/cpan-test.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@
277277
"expected_output": {
278278
"type": "cpan",
279279
"namespace": null,
280-
"name": "perl::Version",
280+
"name": "Perl::Version",
281281
"version": "1.013",
282282
"qualifiers": null,
283283
"subpath": null
@@ -301,7 +301,7 @@
301301
"input": {
302302
"type": "cpan",
303303
"namespace": null,
304-
"name": "perl::Version",
304+
"name": "Perl::Version",
305305
"version": "1.013",
306306
"qualifiers": null,
307307
"subpath": null
@@ -441,7 +441,7 @@
441441
"expected_output": {
442442
"type": "cpan",
443443
"namespace": null,
444-
"name": "lwp::UserAgent",
444+
"name": "LWP::UserAgent",
445445
"version": null,
446446
"qualifiers": null,
447447
"subpath": null
@@ -465,7 +465,7 @@
465465
"input": {
466466
"type": "cpan",
467467
"namespace": null,
468-
"name": "lwp::UserAgent",
468+
"name": "LWP::UserAgent",
469469
"version": null,
470470
"qualifiers": null,
471471
"subpath": null

tests/types/oci-test.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"tests": [
44
{
55
"description": "Parse test for <class 'type'> PURL",
6-
"test_group": "base",
6+
"test_group": "advanced",
77
"test_type": "parse",
88
"input": "pkg:oci/debian@sha256%3A244fd47e07d10?repository_url=docker.io/library/debian&arch=amd64&tag=latest",
99
"expected_output": {
@@ -23,10 +23,10 @@
2323
},
2424
{
2525
"description": "Rountrip test for <class 'type'> PURL",
26-
"test_group": "base",
26+
"test_group": "advanced",
2727
"test_type": "roundtrip",
2828
"input": "pkg:oci/debian@sha256%3A244fd47e07d10?repository_url=docker.io/library/debian&arch=amd64&tag=latest",
29-
"expected_output": "pkg:oci/debian@sha256%3A244fd47e07d10?repository_url=docker.io/library/debian&arch=amd64&tag=latest",
29+
"expected_output": "pkg:oci/debian@sha256:244fd47e07d10?arch=amd64&repository_url=docker.io/library/debian&tag=latest",
3030
"expected_failure": false,
3131
"expected_failure_reason": null
3232
},
@@ -46,13 +46,13 @@
4646
},
4747
"subpath": null
4848
},
49-
"expected_output": "pkg:oci/debian@sha256%3A244fd47e07d10?repository_url=docker.io/library/debian&arch=amd64&tag=latest",
49+
"expected_output": "pkg:oci/debian@sha256:244fd47e07d10?arch=amd64&repository_url=docker.io/library/debian&tag=latest",
5050
"expected_failure": false,
5151
"expected_failure_reason": null
5252
},
5353
{
5454
"description": "Parse test for <class 'type'> PURL",
55-
"test_group": "base",
55+
"test_group": "advanced",
5656
"test_type": "parse",
5757
"input": "pkg:oci/debian@sha256%3A244fd47e07d10?repository_url=ghcr.io/debian&tag=bullseye",
5858
"expected_output": {
@@ -71,16 +71,16 @@
7171
},
7272
{
7373
"description": "Rountrip test for <class 'type'> PURL",
74-
"test_group": "base",
74+
"test_group": "advanced",
7575
"test_type": "roundtrip",
7676
"input": "pkg:oci/debian@sha256%3A244fd47e07d10?repository_url=ghcr.io/debian&tag=bullseye",
77-
"expected_output": "pkg:oci/debian@sha256%3A244fd47e07d10?repository_url=ghcr.io/debian&tag=bullseye",
77+
"expected_output": "pkg:oci/debian@sha256:244fd47e07d10?repository_url=ghcr.io/debian&tag=bullseye",
7878
"expected_failure": false,
7979
"expected_failure_reason": null
8080
},
8181
{
8282
"description": "Build test for <class 'type'> PURL",
83-
"test_group": "base",
83+
"test_group": "advanced",
8484
"test_type": "build",
8585
"input": {
8686
"type": "oci",
@@ -93,13 +93,13 @@
9393
},
9494
"subpath": null
9595
},
96-
"expected_output": "pkg:oci/debian@sha256%3A244fd47e07d10?repository_url=ghcr.io/debian&tag=bullseye",
96+
"expected_output": "pkg:oci/debian@sha256:244fd47e07d10?repository_url=ghcr.io/debian&tag=bullseye",
9797
"expected_failure": false,
9898
"expected_failure_reason": null
9999
},
100100
{
101101
"description": "Parse test for <class 'type'> PURL",
102-
"test_group": "base",
102+
"test_group": "advanced",
103103
"test_type": "parse",
104104
"input": "pkg:oci/static@sha256%3A244fd47e07d10?repository_url=gcr.io/distroless/static&tag=latest",
105105
"expected_output": {
@@ -118,10 +118,10 @@
118118
},
119119
{
120120
"description": "Rountrip test for <class 'type'> PURL",
121-
"test_group": "base",
121+
"test_group": "advanced",
122122
"test_type": "roundtrip",
123123
"input": "pkg:oci/static@sha256%3A244fd47e07d10?repository_url=gcr.io/distroless/static&tag=latest",
124-
"expected_output": "pkg:oci/static@sha256%3A244fd47e07d10?repository_url=gcr.io/distroless/static&tag=latest",
124+
"expected_output": "pkg:oci/static@sha256:244fd47e07d10?repository_url=gcr.io/distroless/static&tag=latest",
125125
"expected_failure": false,
126126
"expected_failure_reason": null
127127
},
@@ -140,13 +140,13 @@
140140
},
141141
"subpath": null
142142
},
143-
"expected_output": "pkg:oci/static@sha256%3A244fd47e07d10?repository_url=gcr.io/distroless/static&tag=latest",
143+
"expected_output": "pkg:oci/static@sha256:244fd47e07d10?repository_url=gcr.io/distroless/static&tag=latest",
144144
"expected_failure": false,
145145
"expected_failure_reason": null
146146
},
147147
{
148148
"description": "Parse test for <class 'type'> PURL",
149-
"test_group": "base",
149+
"test_group": "advanced",
150150
"test_type": "parse",
151151
"input": "pkg:oci/hello-wasm@sha256%3A244fd47e07d10?tag=v1",
152152
"expected_output": {
@@ -164,10 +164,10 @@
164164
},
165165
{
166166
"description": "Rountrip test for <class 'type'> PURL",
167-
"test_group": "base",
167+
"test_group": "advanced",
168168
"test_type": "roundtrip",
169169
"input": "pkg:oci/hello-wasm@sha256%3A244fd47e07d10?tag=v1",
170-
"expected_output": "pkg:oci/hello-wasm@sha256%3A244fd47e07d10?tag=v1",
170+
"expected_output": "pkg:oci/hello-wasm@sha256:244fd47e07d10?tag=v1",
171171
"expected_failure": false,
172172
"expected_failure_reason": null
173173
},
@@ -185,7 +185,7 @@
185185
},
186186
"subpath": null
187187
},
188-
"expected_output": "pkg:oci/hello-wasm@sha256%3A244fd47e07d10?tag=v1",
188+
"expected_output": "pkg:oci/hello-wasm@sha256:244fd47e07d10?tag=v1",
189189
"expected_failure": false,
190190
"expected_failure_reason": null
191191
}

tests/types/swid-test.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"tests": [
44
{
55
"description": "Parse test for <class 'type'> PURL",
6-
"test_group": "base",
6+
"test_group": "advanced",
77
"test_type": "parse",
88
"input": "pkg:swid/Acme/example.com/[email protected]?tag_id=75b8c285-fa7b-485b-b199-4745e3004d0d",
99
"expected_output": {
@@ -21,16 +21,16 @@
2121
},
2222
{
2323
"description": "Rountrip test for <class 'type'> PURL",
24-
"test_group": "base",
24+
"test_group": "advanced",
2525
"test_type": "roundtrip",
2626
"input": "pkg:swid/Acme/example.com/[email protected]?tag_id=75b8c285-fa7b-485b-b199-4745e3004d0d",
27-
"expected_output": "pkg:swid/Acme/example.com/Enterprise+Server@1.0.0?tag_id=75b8c285-fa7b-485b-b199-4745e3004d0d",
27+
"expected_output": "pkg:swid/Acme/example.com/Enterprise%2BServer@1.0.0?tag_id=75b8c285-fa7b-485b-b199-4745e3004d0d",
2828
"expected_failure": false,
2929
"expected_failure_reason": null
3030
},
3131
{
3232
"description": "Build test for <class 'type'> PURL",
33-
"test_group": "base",
33+
"test_group": "advanced",
3434
"test_type": "build",
3535
"input": {
3636
"type": "swid",
@@ -42,7 +42,7 @@
4242
},
4343
"subpath": null
4444
},
45-
"expected_output": "pkg:swid/Acme/example.com/Enterprise+Server@1.0.0?tag_id=75b8c285-fa7b-485b-b199-4745e3004d0d",
45+
"expected_output": "pkg:swid/Acme/example.com/Enterprise%2BServer@1.0.0?tag_id=75b8c285-fa7b-485b-b199-4745e3004d0d",
4646
"expected_failure": false,
4747
"expected_failure_reason": null
4848
},
@@ -93,7 +93,7 @@
9393
},
9494
{
9595
"description": "Parse test for <class 'type'> PURL",
96-
"test_group": "base",
96+
"test_group": "advanced",
9797
"test_type": "parse",
9898
"input": "pkg:swid/Adobe+Systems+Incorporated/Adobe+InDesign@CC?tag_id=CreativeCloud-CS6-Win-GM-MUL",
9999
"expected_output": {
@@ -111,16 +111,16 @@
111111
},
112112
{
113113
"description": "Rountrip test for <class 'type'> PURL",
114-
"test_group": "base",
114+
"test_group": "advanced",
115115
"test_type": "roundtrip",
116116
"input": "pkg:swid/Adobe+Systems+Incorporated/Adobe+InDesign@CC?tag_id=CreativeCloud-CS6-Win-GM-MUL",
117-
"expected_output": "pkg:swid/Adobe+Systems+Incorporated/Adobe+InDesign@CC?tag_id=CreativeCloud-CS6-Win-GM-MUL",
117+
"expected_output": "pkg:swid/Adobe%2BSystems%2BIncorporated/Adobe%2BInDesign@CC?tag_id=CreativeCloud-CS6-Win-GM-MUL",
118118
"expected_failure": false,
119119
"expected_failure_reason": null
120120
},
121121
{
122122
"description": "Build test for <class 'type'> PURL",
123-
"test_group": "base",
123+
"test_group": "advanced",
124124
"test_type": "build",
125125
"input": {
126126
"type": "swid",
@@ -132,7 +132,7 @@
132132
},
133133
"subpath": null
134134
},
135-
"expected_output": "pkg:swid/Adobe+Systems+Incorporated/Adobe+InDesign@CC?tag_id=CreativeCloud-CS6-Win-GM-MUL",
135+
"expected_output": "pkg:swid/Adobe%2BSystems%2BIncorporated/Adobe%2BInDesign@CC?tag_id=CreativeCloud-CS6-Win-GM-MUL",
136136
"expected_failure": false,
137137
"expected_failure_reason": null
138138
}

types-doc/oci-definition.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The structure of a PURL for this package type is:
4444
- `pkg:oci/debian@sha256%3A244fd47e07d10?repository_url=docker.io/library/debian&arch=amd64&tag=latest`
4545
- `pkg:oci/debian@sha256%3A244fd47e07d10?repository_url=ghcr.io/debian&tag=bullseye`
4646
- `pkg:oci/static@sha256%3A244fd47e07d10?repository_url=gcr.io/distroless/static&tag=latest`
47-
- `pkg:oci/hello-wasm@sha256%3A244fd47e07d10?tag=v1`
47+
- `pkg:oci/hello-wasm@sha256:244fd47e07d10?tag=v1`
4848

4949
## Reference URLs
5050

types-doc/swid-definition.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The structure of a PURL for this package type is:
5353

5454
- `pkg:swid/Acme/example.com/[email protected]?tag_id=75b8c285-fa7b-485b-b199-4745e3004d0d`
5555
- `pkg:swid/Fedora@29?tag_id=org.fedoraproject.Fedora-29`
56-
- `pkg:swid/Adobe+Systems+Incorporated/Adobe+InDesign@CC?tag_id=CreativeCloud-CS6-Win-GM-MUL`
56+
- `pkg:swid/Adobe%2BSystems%2BIncorporated/Adobe%2BInDesign@CC?tag_id=CreativeCloud-CS6-Win-GM-MUL`
5757

5858
## Note
5959

types/oci-definition.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@
4141
"pkg:oci/debian@sha256%3A244fd47e07d10?repository_url=docker.io/library/debian&arch=amd64&tag=latest",
4242
"pkg:oci/debian@sha256%3A244fd47e07d10?repository_url=ghcr.io/debian&tag=bullseye",
4343
"pkg:oci/static@sha256%3A244fd47e07d10?repository_url=gcr.io/distroless/static&tag=latest",
44-
"pkg:oci/hello-wasm@sha256%3A244fd47e07d10?tag=v1"
44+
"pkg:oci/hello-wasm@sha256:244fd47e07d10?tag=v1"
4545
]
4646
}

types/swid-definition.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@
5757
"examples": [
5858
"pkg:swid/Acme/example.com/[email protected]?tag_id=75b8c285-fa7b-485b-b199-4745e3004d0d",
5959
"pkg:swid/Fedora@29?tag_id=org.fedoraproject.Fedora-29",
60-
"pkg:swid/Adobe+Systems+Incorporated/Adobe+InDesign@CC?tag_id=CreativeCloud-CS6-Win-GM-MUL"
60+
"pkg:swid/Adobe%2BSystems%2BIncorporated/Adobe%2BInDesign@CC?tag_id=CreativeCloud-CS6-Win-GM-MUL"
6161
]
6262
}

0 commit comments

Comments
 (0)