Debian Codegraph @

t/purl/types/bazel-test.json

raw
1 {
2 "$schema": "https://packageurl.org/schemas/purl-test.schema-0.1.json",
3 "tests": [
4 {
5 "description": "bazel module with default registry",
6 "test_group": "base",
7 "test_type": "roundtrip",
8 "input": "pkg:bazel/[email protected]?repository_url=https://bcr.bazel.build/",
9 "expected_output": "pkg:bazel/[email protected]?repository_url=https:%2F%2Fbcr.bazel.build%2F",
10 "expected_failure": false,
11 "expected_failure_reason": null
12 },
13 {
14 "description": "bazel module with default registry",
15 "test_group": "base",
16 "test_type": "parse",
17 "input": "pkg:bazel/[email protected]?repository_url=https://bcr.bazel.build/",
18 "expected_output": {
19 "type": "bazel",
20 "namespace": null,
21 "name": "rules_java",
22 "version": "7.8.0",
23 "qualifiers": {
24 "repository_url":"https://bcr.bazel.build/"
25 },
26 "subpath": null
27 },
28 "expected_failure": false,
29 "expected_failure_reason": null
30 },
31 {
32 "description": "bazel module with default registry",
33 "test_group": "base",
34 "test_type": "build",
35 "input": {
36 "type": "bazel",
37 "namespace": null,
38 "name": "rules_java",
39 "version": "7.8.0",
40 "qualifiers": null,
41 "subpath": null
42 },
43 "expected_output": "pkg:bazel/[email protected]",
44 "expected_failure": false,
45 "expected_failure_reason": null
46 },
47 {
48 "description": "bazel module with custom registry",
49 "test_group": "advanced",
50 "test_type": "roundtrip",
51 "input": "pkg:bazel/[email protected]?repository_url=https://example.org/bazel-registry/",
52 "expected_output": "pkg:bazel/[email protected]?repository_url=https:%2F%2Fexample.org%2Fbazel-registry%2F",
53 "expected_failure": false,
54 "expected_failure_reason": null
55 },
56 {
57 "description": "bazel module with custom registry",
58 "test_group": "base",
59 "test_type": "parse",
60 "input": "pkg:bazel/[email protected]?repository_url=https://example.org/bazel-registry/",
61 "expected_output": {
62 "type": "bazel",
63 "namespace": null,
64 "name": "rules_java",
65 "version": "7.8.0",
66 "qualifiers": {
67 "repository_url": "https://example.org/bazel-registry/"
68 },
69 "subpath": null
70 },
71 "expected_failure": false,
72 "expected_failure_reason": null
73 },
74 {
75 "description": "bazel module with custom registry",
76 "test_group": "advanced",
77 "test_type": "build",
78 "input": {
79 "type": "bazel",
80 "namespace": null,
81 "name": "rules_java",
82 "version": "7.8.0",
83 "qualifiers": {
84 "repository_url": "https://example.org/bazel-registry"
85 },
86 "subpath": null
87 },
88 "expected_output": "pkg:bazel/[email protected]?repository_url=https:%2F%2Fexample.org%2Fbazel-registry",
89 "expected_failure": false,
90 "expected_failure_reason": null
91 },
92 {
93 "description": "bazel module with relaxed semver version",
94 "test_group": "base",
95 "test_type": "roundtrip",
96 "input": "pkg:bazel/[email protected]",
97 "expected_output": "pkg:bazel/[email protected]",
98 "expected_failure": false,
99 "expected_failure_reason": null
100 },
101 {
102 "description": "bazel module with relaxed semver version",
103 "test_group": "base",
104 "test_type": "parse",
105 "input": "pkg:bazel/[email protected]",
106 "expected_output": {
107 "type": "bazel",
108 "namespace": null,
109 "name": "curl",
110 "version": "8.8.0.bcr.1",
111 "qualifiers": null,
112 "subpath": null
113 },
114 "expected_failure": false,
115 "expected_failure_reason": null
116 },
117 {
118 "description": "bazel module with relaxed semver version",
119 "test_group": "base",
120 "test_type": "build",
121 "input": {
122 "type": "bazel",
123 "namespace": null,
124 "name": "curl",
125 "version": "8.8.0.bcr.1",
126 "qualifiers": null,
127 "subpath": null
128 },
129 "expected_output": "pkg:bazel/[email protected]",
130 "expected_failure": false,
131 "expected_failure_reason": null
132 },
133 {
134 "description": "bazel module names are actually all lowercased, but this is not enforced by the PURL type spec for reasons",
135 "test_group": "base",
136 "test_type": "roundtrip",
137 "input": "pkg:bazel/[email protected]",
138 "expected_output": "pkg:bazel/[email protected]",
139 "expected_failure": false,
140 "expected_failure_reason": null
141 },
142 {
143 "description": "bazel module names are actually all lowercased, but this is not enforced by the PURL type spec for reasons",
144 "test_group": "base",
145 "test_type": "parse",
146 "input": "pkg:bazel/[email protected]",
147 "expected_output": {
148 "type": "bazel",
149 "namespace": null,
150 "name": "Curl",
151 "version": "8.8.0.bcr.1",
152 "qualifiers": null,
153 "subpath": null
154 },
155 "expected_failure": false,
156 "expected_failure_reason": null
157 },
158 {
159 "description": "bazel module names are actually all lowercased, but this is not enforced by the PURL type spec for reasons",
160 "test_group": "base",
161 "test_type": "build",
162 "input": {
163 "type": "bazel",
164 "namespace": null,
165 "name": "Curl",
166 "version": "8.8.0.bcr.1",
167 "qualifiers": null,
168 "subpath": null
169 },
170 "expected_output": "pkg:bazel/[email protected]",
171 "expected_failure": false,
172 "expected_failure_reason": null
173 },
174 {
175 "description": "bazel module with multi-segment package",
176 "test_group": "base",
177 "test_type": "roundtrip",
178 "input": "pkg:bazel/[email protected]#java/runfiles",
179 "expected_output": "pkg:bazel/[email protected]#java/runfiles",
180 "expected_failure": false,
181 "expected_failure_reason": null
182 },
183 {
184 "description": "bazel module with multi-segment package",
185 "test_group": "base",
186 "test_type": "parse",
187 "input": "pkg:bazel/[email protected]#java/runfiles",
188 "expected_output": {
189 "type": "bazel",
190 "namespace": null,
191 "name": "rules_java",
192 "version": "8.5.0",
193 "qualifiers": null,
194 "subpath": "java/runfiles"
195 },
196 "expected_failure": false,
197 "expected_failure_reason": null
198 },
199 {
200 "description": "bazel module with multi-segment package",
201 "test_group": "base",
202 "test_type": "build",
203 "input": {
204 "type": "bazel",
205 "namespace": null,
206 "name": "rules_java",
207 "version": "8.5.0",
208 "qualifiers": null,
209 "subpath": "java/runfiles"
210 },
211 "expected_output": "pkg:bazel/[email protected]#java/runfiles",
212 "expected_failure": false,
213 "expected_failure_reason": null
214 },
215 {
216 "description": "bazel module with target reference",
217 "test_group": "base",
218 "test_type": "roundtrip",
219 "input": "pkg:bazel/[email protected]#java/runfiles:runfiles",
220 "expected_output": "pkg:bazel/[email protected]#java/runfiles:runfiles",
221 "expected_failure": false,
222 "expected_failure_reason": null
223 },
224 {
225 "description": "bazel module with target reference",
226 "test_group": "base",
227 "test_type": "parse",
228 "input": "pkg:bazel/[email protected]#java/runfiles:runfiles",
229 "expected_output": {
230 "type": "bazel",
231 "namespace": null,
232 "name": "rules_java",
233 "version": "8.5.0",
234 "qualifiers": null,
235 "subpath": "java/runfiles:runfiles"
236 },
237 "expected_failure": false,
238 "expected_failure_reason": null
239 },
240 {
241 "description": "bazel module with target reference",
242 "test_group": "base",
243 "test_type": "build",
244 "input": {
245 "type": "bazel",
246 "namespace": null,
247 "name": "rules_java",
248 "version": "8.5.0",
249 "qualifiers": null,
250 "subpath": "java/runfiles:runfiles"
251 },
252 "expected_output": "pkg:bazel/[email protected]#java/runfiles:runfiles",
253 "expected_failure": false,
254 "expected_failure_reason": null
255 },
256 {
257 "description": "bazel module with single-segment package",
258 "test_group": "base",
259 "test_type": "roundtrip",
260 "input": "pkg:bazel/[email protected]#go",
261 "expected_output": "pkg:bazel/[email protected]#go",
262 "expected_failure": false,
263 "expected_failure_reason": null
264 },
265 {
266 "description": "bazel module with single-segment package",
267 "test_group": "base",
268 "test_type": "parse",
269 "input": "pkg:bazel/[email protected]#go",
270 "expected_output": {
271 "type": "bazel",
272 "namespace": null,
273 "name": "rules_go",
274 "version": "0.48.0",
275 "qualifiers": null,
276 "subpath": "go"
277 },
278 "expected_failure": false,
279 "expected_failure_reason": null
280 },
281 {
282 "description": "bazel module with single-segment package",
283 "test_group": "base",
284 "test_type": "build",
285 "input": {
286 "type": "bazel",
287 "namespace": null,
288 "name": "rules_go",
289 "version": "0.48.0",
290 "qualifiers": null,
291 "subpath": "go"
292 },
293 "expected_output": "pkg:bazel/[email protected]#go",
294 "expected_failure": false,
295 "expected_failure_reason": null
296 }
297 ]
298 }