Debian Codegraph @

t/purl/types/golang-test.json

raw
1 {
2 "$schema": "https://packageurl.org/schemas/purl-test.schema-0.1.json",
3 "tests": [
4 {
5 "description": "valid go purl without version and with subpath. Roundtrip an input purl to canonical.",
6 "test_group": "advanced",
7 "test_type": "roundtrip",
8 "input": "pkg:GOLANG/google.golang.org/genproto#/googleapis/api/annotations/",
9 "expected_output": "pkg:golang/google.golang.org/genproto#googleapis/api/annotations",
10 "expected_failure": false,
11 "expected_failure_reason": null
12 },
13 {
14 "description": "valid go purl without version and with subpath",
15 "test_group": "base",
16 "test_type": "parse",
17 "input": "pkg:GOLANG/google.golang.org/genproto#/googleapis/api/annotations/",
18 "expected_output": {
19 "type": "golang",
20 "namespace": "google.golang.org",
21 "name": "genproto",
22 "version": null,
23 "qualifiers": null,
24 "subpath": "googleapis/api/annotations"
25 },
26 "expected_failure": false,
27 "expected_failure_reason": null
28 },
29 {
30 "description": "valid go purl without version and with subpath. Roundtrip a canonical input to canonical output.",
31 "test_group": "base",
32 "test_type": "roundtrip",
33 "input": "pkg:golang/google.golang.org/genproto#googleapis/api/annotations",
34 "expected_output": "pkg:golang/google.golang.org/genproto#googleapis/api/annotations",
35 "expected_failure": false,
36 "expected_failure_reason": null
37 },
38 {
39 "description": "valid go purl without version and with subpath",
40 "test_group": "base",
41 "test_type": "build",
42 "input": {
43 "type": "golang",
44 "namespace": "google.golang.org",
45 "name": "genproto",
46 "version": null,
47 "qualifiers": null,
48 "subpath": "googleapis/api/annotations"
49 },
50 "expected_output": "pkg:golang/google.golang.org/genproto#googleapis/api/annotations",
51 "expected_failure": false,
52 "expected_failure_reason": null
53 },
54 {
55 "description": "valid go purl with version and subpath. Roundtrip an input purl to canonical.",
56 "test_group": "advanced",
57 "test_type": "roundtrip",
58 "input": "pkg:GOLANG/google.golang.org/genproto@abcdedf#/googleapis/api/annotations/",
59 "expected_output": "pkg:golang/google.golang.org/genproto@abcdedf#googleapis/api/annotations",
60 "expected_failure": false,
61 "expected_failure_reason": null
62 },
63 {
64 "description": "valid go purl with version and subpath",
65 "test_group": "base",
66 "test_type": "parse",
67 "input": "pkg:GOLANG/google.golang.org/genproto@abcdedf#/googleapis/api/annotations/",
68 "expected_output": {
69 "type": "golang",
70 "namespace": "google.golang.org",
71 "name": "genproto",
72 "version": "abcdedf",
73 "qualifiers": null,
74 "subpath": "googleapis/api/annotations"
75 },
76 "expected_failure": false,
77 "expected_failure_reason": null
78 },
79 {
80 "description": "valid go purl with version and subpath. Roundtrip a canonical input to canonical output.",
81 "test_group": "base",
82 "test_type": "roundtrip",
83 "input": "pkg:golang/google.golang.org/genproto@abcdedf#googleapis/api/annotations",
84 "expected_output": "pkg:golang/google.golang.org/genproto@abcdedf#googleapis/api/annotations",
85 "expected_failure": false,
86 "expected_failure_reason": null
87 },
88 {
89 "description": "valid go purl with version and subpath",
90 "test_group": "base",
91 "test_type": "build",
92 "input": {
93 "type": "golang",
94 "namespace": "google.golang.org",
95 "name": "genproto",
96 "version": "abcdedf",
97 "qualifiers": null,
98 "subpath": "googleapis/api/annotations"
99 },
100 "expected_output": "pkg:golang/google.golang.org/genproto@abcdedf#googleapis/api/annotations",
101 "expected_failure": false,
102 "expected_failure_reason": null
103 },
104 {
105 "description": "Parse test for PURL type: golang",
106 "test_group": "base",
107 "test_type": "parse",
108 "input": "pkg:golang/github.com/gorilla/context@234fd47e07d1004f0aed9c",
109 "expected_output": {
110 "type": "golang",
111 "namespace": "github.com/gorilla",
112 "name": "context",
113 "version": "234fd47e07d1004f0aed9c",
114 "qualifiers": null,
115 "subpath": null
116 },
117 "expected_failure": false,
118 "expected_failure_reason": null
119 },
120 {
121 "description": "Roundtrip test for PURL type: golang",
122 "test_group": "base",
123 "test_type": "roundtrip",
124 "input": "pkg:golang/github.com/gorilla/context@234fd47e07d1004f0aed9c",
125 "expected_output": "pkg:golang/github.com/gorilla/context@234fd47e07d1004f0aed9c",
126 "expected_failure": false,
127 "expected_failure_reason": null
128 },
129 {
130 "description": "Build test for PURL type: golang",
131 "test_group": "base",
132 "test_type": "build",
133 "input": {
134 "type": "golang",
135 "namespace": "github.com/gorilla",
136 "name": "context",
137 "version": "234fd47e07d1004f0aed9c",
138 "qualifiers": null,
139 "subpath": null
140 },
141 "expected_output": "pkg:golang/github.com/gorilla/context@234fd47e07d1004f0aed9c",
142 "expected_failure": false,
143 "expected_failure_reason": null
144 },
145 {
146 "description": "Parse test for PURL type: golang",
147 "test_group": "base",
148 "test_type": "parse",
149 "input": "pkg:golang/google.golang.org/genproto#googleapis/api/annotations",
150 "expected_output": {
151 "type": "golang",
152 "namespace": "google.golang.org",
153 "name": "genproto",
154 "version": null,
155 "qualifiers": null,
156 "subpath": "googleapis/api/annotations"
157 },
158 "expected_failure": false,
159 "expected_failure_reason": null
160 },
161 {
162 "description": "Roundtrip test for PURL type: golang",
163 "test_group": "base",
164 "test_type": "roundtrip",
165 "input": "pkg:golang/google.golang.org/genproto#googleapis/api/annotations",
166 "expected_output": "pkg:golang/google.golang.org/genproto#googleapis/api/annotations",
167 "expected_failure": false,
168 "expected_failure_reason": null
169 },
170 {
171 "description": "Build test for PURL type: golang",
172 "test_group": "base",
173 "test_type": "build",
174 "input": {
175 "type": "golang",
176 "namespace": "google.golang.org",
177 "name": "genproto",
178 "version": null,
179 "qualifiers": null,
180 "subpath": "googleapis/api/annotations"
181 },
182 "expected_output": "pkg:golang/google.golang.org/genproto#googleapis/api/annotations",
183 "expected_failure": false,
184 "expected_failure_reason": null
185 },
186 {
187 "description": "Parse test for PURL type: golang",
188 "test_group": "base",
189 "test_type": "parse",
190 "input": "pkg:golang/github.com/gorilla/context@234fd47e07d1004f0aed9c#api",
191 "expected_output": {
192 "type": "golang",
193 "namespace": "github.com/gorilla",
194 "name": "context",
195 "version": "234fd47e07d1004f0aed9c",
196 "qualifiers": null,
197 "subpath": "api"
198 },
199 "expected_failure": false,
200 "expected_failure_reason": null
201 },
202 {
203 "description": "Roundtrip test for PURL type: golang",
204 "test_group": "base",
205 "test_type": "roundtrip",
206 "input": "pkg:golang/github.com/gorilla/context@234fd47e07d1004f0aed9c#api",
207 "expected_output": "pkg:golang/github.com/gorilla/context@234fd47e07d1004f0aed9c#api",
208 "expected_failure": false,
209 "expected_failure_reason": null
210 },
211 {
212 "description": "Build test for PURL type: golang",
213 "test_group": "base",
214 "test_type": "build",
215 "input": {
216 "type": "golang",
217 "namespace": "github.com/gorilla",
218 "name": "context",
219 "version": "234fd47e07d1004f0aed9c",
220 "qualifiers": null,
221 "subpath": "api"
222 },
223 "expected_output": "pkg:golang/github.com/gorilla/context@234fd47e07d1004f0aed9c#api",
224 "expected_failure": false,
225 "expected_failure_reason": null
226 }
227 ]
228 }