| 1 | { |
| 2 | "$schema": "https://packageurl.org/schemas/purl-test.schema-0.1.json", |
| 3 | "tests": [ |
| 4 | { |
| 5 | "description": "simple vcpkg purl", |
| 6 | "test_group": "base", |
| 7 | "test_type": "parse", |
| 8 | "input": "pkg:vcpkg/[email protected]", |
| 9 | "expected_output": { |
| 10 | "type": "vcpkg", |
| 11 | "namespace": null, |
| 12 | "name": "bzip2", |
| 13 | "version": "1.0.8", |
| 14 | "qualifiers": null, |
| 15 | "subpath": null |
| 16 | }, |
| 17 | "expected_failure": false, |
| 18 | "expected_failure_reason": null |
| 19 | }, |
| 20 | { |
| 21 | "description": "vcpkg with port_version", |
| 22 | "test_group": "base", |
| 23 | "test_type": "parse", |
| 24 | "input": "pkg:vcpkg/[email protected]?port_version=6", |
| 25 | "expected_output": { |
| 26 | "type": "vcpkg", |
| 27 | "namespace": null, |
| 28 | "name": "bzip2", |
| 29 | "version": "1.0.8", |
| 30 | "qualifiers": { |
| 31 | "port_version": "6" |
| 32 | }, |
| 33 | "subpath": null |
| 34 | }, |
| 35 | "expected_failure": false, |
| 36 | "expected_failure_reason": null |
| 37 | }, |
| 38 | { |
| 39 | "description": "vcpkg non-default git registry", |
| 40 | "test_group": "base", |
| 41 | "test_type": "parse", |
| 42 | "input": "pkg:vcpkg/[email protected]?repository_url=https:%2F%2Fgithub.com%2Fazure-sdk%2Fvcpkg&port_version=3", |
| 43 | "expected_output": { |
| 44 | "type": "vcpkg", |
| 45 | "namespace": null, |
| 46 | "name": "ffmpeg", |
| 47 | "version": "5.1.2", |
| 48 | "qualifiers": { |
| 49 | "repository_url": "https://github.com/azure-sdk/vcpkg", |
| 50 | "port_version": "3" |
| 51 | }, |
| 52 | "subpath": null |
| 53 | }, |
| 54 | "expected_failure": false, |
| 55 | "expected_failure_reason": null |
| 56 | }, |
| 57 | { |
| 58 | "description": "vcpkg filesystem registry or overlay port", |
| 59 | "test_group": "base", |
| 60 | "test_type": "parse", |
| 61 | "input": "pkg:vcpkg/[email protected]?repository_url=file:%2F%2F%2FC:%2Flocal-registry%2Fvcpkg&port_version=3", |
| 62 | "expected_output": { |
| 63 | "type": "vcpkg", |
| 64 | "namespace": null, |
| 65 | "name": "llvm", |
| 66 | "version": "15.0.7", |
| 67 | "qualifiers": { |
| 68 | "repository_url": "file:///C:/local-registry/vcpkg", |
| 69 | "port_version": "3" |
| 70 | }, |
| 71 | "subpath": null |
| 72 | }, |
| 73 | "expected_failure": false, |
| 74 | "expected_failure_reason": null |
| 75 | }, |
| 76 | { |
| 77 | "description": "vcpkg with additional qualifiers", |
| 78 | "test_group": "base", |
| 79 | "test_type": "parse", |
| 80 | "input": "pkg:vcpkg/[email protected]?port_version=6&repository_revision=84a143e4caf6b70db57f28d04c41df4a85c480fa&triplet=x64-linux", |
| 81 | "expected_output": { |
| 82 | "type": "vcpkg", |
| 83 | "namespace": null, |
| 84 | "name": "bzip2", |
| 85 | "version": "1.0.8", |
| 86 | "qualifiers": { |
| 87 | "port_version": "6", |
| 88 | "repository_revision": "84a143e4caf6b70db57f28d04c41df4a85c480fa", |
| 89 | "triplet": "x64-linux" |
| 90 | }, |
| 91 | "subpath": null |
| 92 | }, |
| 93 | "expected_failure": false, |
| 94 | "expected_failure_reason": null |
| 95 | }, |
| 96 | { |
| 97 | "description": "vcpkg with a vcs_url pinning the port git-tree in the default registry", |
| 98 | "test_group": "base", |
| 99 | "test_type": "parse", |
| 100 | "input": "pkg:vcpkg/[email protected]?triplet=x64-linux&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Fmicrosoft%2Fvcpkg%40b5d3197b1a8a3f4c2d9e0f1a2b3c4d5e6f708192", |
| 101 | "expected_output": { |
| 102 | "type": "vcpkg", |
| 103 | "namespace": null, |
| 104 | "name": "zlib", |
| 105 | "version": "1.3.1", |
| 106 | "qualifiers": { |
| 107 | "triplet": "x64-linux", |
| 108 | "vcs_url": "git+https://github.com/microsoft/vcpkg@b5d3197b1a8a3f4c2d9e0f1a2b3c4d5e6f708192" |
| 109 | }, |
| 110 | "subpath": null |
| 111 | }, |
| 112 | "expected_failure": false, |
| 113 | "expected_failure_reason": null |
| 114 | }, |
| 115 | { |
| 116 | "description": "vcpkg from a non-default git registry with repository_url and a vcs_url git-tree", |
| 117 | "test_group": "base", |
| 118 | "test_type": "parse", |
| 119 | "input": "pkg:vcpkg/[email protected]?repository_url=https:%2F%2Fgithub.com%2Fazure-sdk%2Fvcpkg&triplet=x64-linux&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Fazure-sdk%2Fvcpkg%40b5d3197b1a8a3f4c2d9e0f1a2b3c4d5e6f708192", |
| 120 | "expected_output": { |
| 121 | "type": "vcpkg", |
| 122 | "namespace": null, |
| 123 | "name": "zlib", |
| 124 | "version": "1.3.1", |
| 125 | "qualifiers": { |
| 126 | "repository_url": "https://github.com/azure-sdk/vcpkg", |
| 127 | "triplet": "x64-linux", |
| 128 | "vcs_url": "git+https://github.com/azure-sdk/vcpkg@b5d3197b1a8a3f4c2d9e0f1a2b3c4d5e6f708192" |
| 129 | }, |
| 130 | "subpath": null |
| 131 | }, |
| 132 | "expected_failure": false, |
| 133 | "expected_failure_reason": null |
| 134 | }, |
| 135 | { |
| 136 | "description": "roundtrip a canonical vcpkg purl with triplet and vcs_url", |
| 137 | "test_group": "base", |
| 138 | "test_type": "roundtrip", |
| 139 | "input": "pkg:vcpkg/[email protected]?triplet=x64-linux&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Fmicrosoft%2Fvcpkg%40b5d3197b1a8a3f4c2d9e0f1a2b3c4d5e6f708192", |
| 140 | "expected_output": "pkg:vcpkg/[email protected]?triplet=x64-linux&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Fmicrosoft%2Fvcpkg%40b5d3197b1a8a3f4c2d9e0f1a2b3c4d5e6f708192", |
| 141 | "expected_failure": false, |
| 142 | "expected_failure_reason": null |
| 143 | }, |
| 144 | { |
| 145 | "description": "build a vcpkg purl with triplet and vcs_url sorts qualifiers and encodes the vcs_url", |
| 146 | "test_group": "base", |
| 147 | "test_type": "build", |
| 148 | "input": { |
| 149 | "type": "vcpkg", |
| 150 | "namespace": null, |
| 151 | "name": "zlib", |
| 152 | "version": "1.3.1", |
| 153 | "qualifiers": { |
| 154 | "vcs_url": "git+https://github.com/microsoft/vcpkg@b5d3197b1a8a3f4c2d9e0f1a2b3c4d5e6f708192", |
| 155 | "triplet": "x64-linux" |
| 156 | }, |
| 157 | "subpath": null |
| 158 | }, |
| 159 | "expected_output": "pkg:vcpkg/[email protected]?triplet=x64-linux&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Fmicrosoft%2Fvcpkg%40b5d3197b1a8a3f4c2d9e0f1a2b3c4d5e6f708192", |
| 160 | "expected_failure": false, |
| 161 | "expected_failure_reason": null |
| 162 | }, |
| 163 | { |
| 164 | "description": "vcpkg namespace is prohibited; boost-asio is a single port name, not a namespace and name", |
| 165 | "test_group": "base", |
| 166 | "test_type": "parse", |
| 167 | "input": "pkg:vcpkg/boost/[email protected]", |
| 168 | "expected_output": null, |
| 169 | "expected_failure": true, |
| 170 | "expected_failure_reason": "Should fail to parse a vcpkg purl with a namespace because vcpkg namespaces are prohibited" |
| 171 | }, |
| 172 | { |
| 173 | "description": "vcpkg purl without a name", |
| 174 | "test_group": "base", |
| 175 | "test_type": "parse", |
| 176 | "input": "pkg:vcpkg/@1.0.8", |
| 177 | "expected_output": null, |
| 178 | "expected_failure": true, |
| 179 | "expected_failure_reason": "Should fail to parse a vcpkg purl without a name because the name is required" |
| 180 | }, |
| 181 | { |
| 182 | "description": "vcpkg purl with only the type and no name", |
| 183 | "test_group": "base", |
| 184 | "test_type": "parse", |
| 185 | "input": "pkg:vcpkg", |
| 186 | "expected_output": null, |
| 187 | "expected_failure": true, |
| 188 | "expected_failure_reason": "Should fail to parse a vcpkg purl without a name because the name is required" |
| 189 | }, |
| 190 | { |
| 191 | "description": "vcpkg build with a prohibited namespace", |
| 192 | "test_group": "base", |
| 193 | "test_type": "build", |
| 194 | "input": { |
| 195 | "type": "vcpkg", |
| 196 | "namespace": "boost", |
| 197 | "name": "asio", |
| 198 | "version": "1.84.0", |
| 199 | "qualifiers": null, |
| 200 | "subpath": null |
| 201 | }, |
| 202 | "expected_output": null, |
| 203 | "expected_failure": true, |
| 204 | "expected_failure_reason": "Should fail to build a vcpkg purl with a namespace because vcpkg namespaces are prohibited" |
| 205 | }, |
| 206 | { |
| 207 | "description": "vcpkg build without a name", |
| 208 | "test_group": "base", |
| 209 | "test_type": "build", |
| 210 | "input": { |
| 211 | "type": "vcpkg", |
| 212 | "namespace": null, |
| 213 | "name": null, |
| 214 | "version": "1.0.8", |
| 215 | "qualifiers": null, |
| 216 | "subpath": null |
| 217 | }, |
| 218 | "expected_output": null, |
| 219 | "expected_failure": true, |
| 220 | "expected_failure_reason": "Should fail to build a vcpkg purl without a name because the name is required" |
| 221 | }, |
| 222 | { |
| 223 | "description": "a trailing #6 is parsed as a subpath, not a port-version, which is why port_version is a qualifier", |
| 224 | "test_group": "advanced", |
| 225 | "test_type": "parse", |
| 226 | "input": "pkg:vcpkg/[email protected]#6", |
| 227 | "expected_output": { |
| 228 | "type": "vcpkg", |
| 229 | "namespace": null, |
| 230 | "name": "zlib", |
| 231 | "version": "1.3.1", |
| 232 | "qualifiers": null, |
| 233 | "subpath": "6" |
| 234 | }, |
| 235 | "expected_failure": false, |
| 236 | "expected_failure_reason": null |
| 237 | }, |
| 238 | { |
| 239 | "description": "vcpkg purl with a features qualifier listing enabled features", |
| 240 | "test_group": "advanced", |
| 241 | "test_type": "parse", |
| 242 | "input": "pkg:vcpkg/[email protected]?features=ssl%2Chttp2", |
| 243 | "expected_output": { |
| 244 | "type": "vcpkg", |
| 245 | "namespace": null, |
| 246 | "name": "curl", |
| 247 | "version": "8.6.0", |
| 248 | "qualifiers": { |
| 249 | "features": "ssl,http2" |
| 250 | }, |
| 251 | "subpath": null |
| 252 | }, |
| 253 | "expected_failure": false, |
| 254 | "expected_failure_reason": null |
| 255 | }, |
| 256 | { |
| 257 | "description": "vcpkg purl with a static-linkage triplet", |
| 258 | "test_group": "base", |
| 259 | "test_type": "parse", |
| 260 | "input": "pkg:vcpkg/[email protected]?triplet=x64-windows-static", |
| 261 | "expected_output": { |
| 262 | "type": "vcpkg", |
| 263 | "namespace": null, |
| 264 | "name": "zlib", |
| 265 | "version": "1.3.1", |
| 266 | "qualifiers": { |
| 267 | "triplet": "x64-windows-static" |
| 268 | }, |
| 269 | "subpath": null |
| 270 | }, |
| 271 | "expected_failure": false, |
| 272 | "expected_failure_reason": null |
| 273 | }, |
| 274 | { |
| 275 | "description": "roundtrip a canonical vcpkg purl with a port_version", |
| 276 | "test_group": "base", |
| 277 | "test_type": "roundtrip", |
| 278 | "input": "pkg:vcpkg/[email protected]?port_version=6", |
| 279 | "expected_output": "pkg:vcpkg/[email protected]?port_version=6", |
| 280 | "expected_failure": false, |
| 281 | "expected_failure_reason": null |
| 282 | }, |
| 283 | { |
| 284 | "description": "build a vcpkg purl with a port_version", |
| 285 | "test_group": "base", |
| 286 | "test_type": "build", |
| 287 | "input": { |
| 288 | "type": "vcpkg", |
| 289 | "namespace": null, |
| 290 | "name": "bzip2", |
| 291 | "version": "1.0.8", |
| 292 | "qualifiers": { |
| 293 | "port_version": "6" |
| 294 | }, |
| 295 | "subpath": null |
| 296 | }, |
| 297 | "expected_output": "pkg:vcpkg/[email protected]?port_version=6", |
| 298 | "expected_failure": false, |
| 299 | "expected_failure_reason": null |
| 300 | }, |
| 301 | { |
| 302 | "description": "build a vcpkg purl without a port_version omits the qualifier", |
| 303 | "test_group": "base", |
| 304 | "test_type": "build", |
| 305 | "input": { |
| 306 | "type": "vcpkg", |
| 307 | "namespace": null, |
| 308 | "name": "bzip2", |
| 309 | "version": "1.0.8", |
| 310 | "qualifiers": null, |
| 311 | "subpath": null |
| 312 | }, |
| 313 | "expected_output": "pkg:vcpkg/[email protected]", |
| 314 | "expected_failure": false, |
| 315 | "expected_failure_reason": null |
| 316 | } |
| 317 | ] |
| 318 | } |