| 1 | { |
| 2 | "$schema": "https://packageurl.org/schemas/purl-test.schema-0.1.json", |
| 3 | "tests": [ |
| 4 | { |
| 5 | "description": "Simple Homebrew formula with version", |
| 6 | "test_group": "base", |
| 7 | "test_type": "parse", |
| 8 | "input": "pkg:brew/[email protected]", |
| 9 | "expected_output": { |
| 10 | "type": "brew", |
| 11 | "namespace": null, |
| 12 | "name": "sqlite", |
| 13 | "version": "3.43.2", |
| 14 | "qualifiers": null, |
| 15 | "subpath": null |
| 16 | }, |
| 17 | "expected_failure": false, |
| 18 | "expected_failure_reason": null |
| 19 | }, |
| 20 | { |
| 21 | "description": "Simple Homebrew formula with version - roundtrip", |
| 22 | "test_group": "base", |
| 23 | "test_type": "roundtrip", |
| 24 | "input": "pkg:brew/[email protected]", |
| 25 | "expected_output": "pkg:brew/[email protected]", |
| 26 | "expected_failure": false, |
| 27 | "expected_failure_reason": null |
| 28 | }, |
| 29 | { |
| 30 | "description": "Simple Homebrew formula with version - build", |
| 31 | "test_group": "base", |
| 32 | "test_type": "build", |
| 33 | "input": { |
| 34 | "type": "brew", |
| 35 | "namespace": null, |
| 36 | "name": "sqlite", |
| 37 | "version": "3.43.2", |
| 38 | "qualifiers": null, |
| 39 | "subpath": null |
| 40 | }, |
| 41 | "expected_output": "pkg:brew/[email protected]", |
| 42 | "expected_failure": false, |
| 43 | "expected_failure_reason": null |
| 44 | }, |
| 45 | { |
| 46 | "description": "Homebrew formula names are not case sensitive", |
| 47 | "test_group": "base", |
| 48 | "test_type": "parse", |
| 49 | "input": "pkg:brew/[email protected]", |
| 50 | "expected_output": { |
| 51 | "type": "brew", |
| 52 | "namespace": null, |
| 53 | "name": "sqlite", |
| 54 | "version": "3.43.2", |
| 55 | "qualifiers": null, |
| 56 | "subpath": null |
| 57 | }, |
| 58 | "expected_failure": false, |
| 59 | "expected_failure_reason": null |
| 60 | }, |
| 61 | { |
| 62 | "description": "Homebrew formula names are not case sensitive. Roundtrip an input purl to canonical.", |
| 63 | "test_group": "advanced", |
| 64 | "test_type": "roundtrip", |
| 65 | "input": "pkg:brew/[email protected]", |
| 66 | "expected_output": "pkg:brew/[email protected]", |
| 67 | "expected_failure": false, |
| 68 | "expected_failure_reason": null |
| 69 | }, |
| 70 | { |
| 71 | "description": "Homebrew formula without version (versionless purl)", |
| 72 | "test_group": "base", |
| 73 | "test_type": "parse", |
| 74 | "input": "pkg:brew/go", |
| 75 | "expected_output": { |
| 76 | "type": "brew", |
| 77 | "namespace": null, |
| 78 | "name": "go", |
| 79 | "version": null, |
| 80 | "qualifiers": null, |
| 81 | "subpath": null |
| 82 | }, |
| 83 | "expected_failure": false, |
| 84 | "expected_failure_reason": null |
| 85 | }, |
| 86 | { |
| 87 | "description": "Homebrew formula without version - roundtrip", |
| 88 | "test_group": "base", |
| 89 | "test_type": "roundtrip", |
| 90 | "input": "pkg:brew/go", |
| 91 | "expected_output": "pkg:brew/go", |
| 92 | "expected_failure": false, |
| 93 | "expected_failure_reason": null |
| 94 | }, |
| 95 | { |
| 96 | "description": "Homebrew formula without version - build", |
| 97 | "test_group": "base", |
| 98 | "test_type": "build", |
| 99 | "input": { |
| 100 | "type": "brew", |
| 101 | "namespace": null, |
| 102 | "name": "go", |
| 103 | "version": null, |
| 104 | "qualifiers": null, |
| 105 | "subpath": null |
| 106 | }, |
| 107 | "expected_output": "pkg:brew/go", |
| 108 | "expected_failure": false, |
| 109 | "expected_failure_reason": null |
| 110 | }, |
| 111 | { |
| 112 | "description": "Versioned formula with @ in name (postgresql@12) - @ must be percent-encoded", |
| 113 | "test_group": "base", |
| 114 | "test_type": "parse", |
| 115 | "input": "pkg:brew/postgresql%[email protected]", |
| 116 | "expected_output": { |
| 117 | "type": "brew", |
| 118 | "namespace": null, |
| 119 | "name": "postgresql@12", |
| 120 | "version": "12.17", |
| 121 | "qualifiers": null, |
| 122 | "subpath": null |
| 123 | }, |
| 124 | "expected_failure": false, |
| 125 | "expected_failure_reason": null |
| 126 | }, |
| 127 | { |
| 128 | "description": "Versioned formula with @ in name - roundtrip", |
| 129 | "test_group": "base", |
| 130 | "test_type": "roundtrip", |
| 131 | "input": "pkg:brew/postgresql%[email protected]", |
| 132 | "expected_output": "pkg:brew/postgresql%[email protected]", |
| 133 | "expected_failure": false, |
| 134 | "expected_failure_reason": null |
| 135 | }, |
| 136 | { |
| 137 | "description": "Versioned formula with @ in name - build", |
| 138 | "test_group": "base", |
| 139 | "test_type": "build", |
| 140 | "input": { |
| 141 | "type": "brew", |
| 142 | "namespace": null, |
| 143 | "name": "postgresql@12", |
| 144 | "version": "12.17", |
| 145 | "qualifiers": null, |
| 146 | "subpath": null |
| 147 | }, |
| 148 | "expected_output": "pkg:brew/postgresql%[email protected]", |
| 149 | "expected_failure": false, |
| 150 | "expected_failure_reason": null |
| 151 | }, |
| 152 | { |
| 153 | "description": "Homebrew formula with namespace (tap) - parse", |
| 154 | "test_group": "base", |
| 155 | "test_type": "parse", |
| 156 | "input": "pkg:brew/homebrew/core/[email protected]", |
| 157 | "expected_output": { |
| 158 | "type": "brew", |
| 159 | "namespace": "homebrew/core", |
| 160 | "name": "sqlite", |
| 161 | "version": "3.43.2", |
| 162 | "qualifiers": null, |
| 163 | "subpath": null |
| 164 | }, |
| 165 | "expected_failure": false, |
| 166 | "expected_failure_reason": null |
| 167 | }, |
| 168 | { |
| 169 | "description": "Homebrew formula with namespace (tap) - roundtrip", |
| 170 | "test_group": "base", |
| 171 | "test_type": "roundtrip", |
| 172 | "input": "pkg:brew/homebrew/core/[email protected]", |
| 173 | "expected_output": "pkg:brew/homebrew/core/[email protected]", |
| 174 | "expected_failure": false, |
| 175 | "expected_failure_reason": null |
| 176 | }, |
| 177 | { |
| 178 | "description": "Homebrew formula with namespace (tap) - build", |
| 179 | "test_group": "base", |
| 180 | "test_type": "build", |
| 181 | "input": { |
| 182 | "type": "brew", |
| 183 | "namespace": "homebrew/core", |
| 184 | "name": "sqlite", |
| 185 | "version": "3.43.2", |
| 186 | "qualifiers": null, |
| 187 | "subpath": null |
| 188 | }, |
| 189 | "expected_output": "pkg:brew/homebrew/core/[email protected]", |
| 190 | "expected_failure": false, |
| 191 | "expected_failure_reason": null |
| 192 | }, |
| 193 | { |
| 194 | "description": "Homebrew tap namespaces are not case sensitive", |
| 195 | "test_group": "base", |
| 196 | "test_type": "parse", |
| 197 | "input": "pkg:brew/Homebrew/Core/[email protected]", |
| 198 | "expected_output": { |
| 199 | "type": "brew", |
| 200 | "namespace": "homebrew/core", |
| 201 | "name": "sqlite", |
| 202 | "version": "3.43.2", |
| 203 | "qualifiers": null, |
| 204 | "subpath": null |
| 205 | }, |
| 206 | "expected_failure": false, |
| 207 | "expected_failure_reason": null |
| 208 | }, |
| 209 | { |
| 210 | "description": "Homebrew tap namespaces are not case sensitive. Roundtrip an input purl to canonical.", |
| 211 | "test_group": "advanced", |
| 212 | "test_type": "roundtrip", |
| 213 | "input": "pkg:brew/Homebrew/Core/[email protected]", |
| 214 | "expected_output": "pkg:brew/homebrew/core/[email protected]", |
| 215 | "expected_failure": false, |
| 216 | "expected_failure_reason": null |
| 217 | }, |
| 218 | { |
| 219 | "description": "Homebrew formula with third-party tap and repository_url - parse", |
| 220 | "test_group": "base", |
| 221 | "test_type": "parse", |
| 222 | "input": "pkg:brew/some-org/some-tap/[email protected]?repository_url=https:%2F%2Fgithub.com%2Fsome-org%2Fhomebrew-some-tap.git", |
| 223 | "expected_output": { |
| 224 | "type": "brew", |
| 225 | "namespace": "some-org/some-tap", |
| 226 | "name": "some-app", |
| 227 | "version": "1.2.3", |
| 228 | "qualifiers": { |
| 229 | "repository_url": "https://github.com/some-org/homebrew-some-tap.git" |
| 230 | }, |
| 231 | "subpath": null |
| 232 | }, |
| 233 | "expected_failure": false, |
| 234 | "expected_failure_reason": null |
| 235 | }, |
| 236 | { |
| 237 | "description": "Homebrew formula with third-party tap and repository_url - roundtrip", |
| 238 | "test_group": "base", |
| 239 | "test_type": "roundtrip", |
| 240 | "input": "pkg:brew/some-org/some-tap/[email protected]?repository_url=https:%2F%2Fgithub.com%2Fsome-org%2Fhomebrew-some-tap.git", |
| 241 | "expected_output": "pkg:brew/some-org/some-tap/[email protected]?repository_url=https:%2F%2Fgithub.com%2Fsome-org%2Fhomebrew-some-tap.git", |
| 242 | "expected_failure": false, |
| 243 | "expected_failure_reason": null |
| 244 | }, |
| 245 | { |
| 246 | "description": "Homebrew formula with third-party tap and repository_url - build", |
| 247 | "test_group": "base", |
| 248 | "test_type": "build", |
| 249 | "input": { |
| 250 | "type": "brew", |
| 251 | "namespace": "some-org/some-tap", |
| 252 | "name": "some-app", |
| 253 | "version": "1.2.3", |
| 254 | "qualifiers": { |
| 255 | "repository_url": "https://github.com/some-org/homebrew-some-tap.git" |
| 256 | }, |
| 257 | "subpath": null |
| 258 | }, |
| 259 | "expected_output": "pkg:brew/some-org/some-tap/[email protected]?repository_url=https:%2F%2Fgithub.com%2Fsome-org%2Fhomebrew-some-tap.git", |
| 260 | "expected_failure": false, |
| 261 | "expected_failure_reason": null |
| 262 | }, |
| 263 | { |
| 264 | "description": "Versioned formula with unencoded @ should parse (advanced)", |
| 265 | "test_group": "advanced", |
| 266 | "test_type": "roundtrip", |
| 267 | "input": "pkg:brew/node@[email protected]", |
| 268 | "expected_output": "pkg:brew/node%[email protected]", |
| 269 | "expected_failure": false, |
| 270 | "expected_failure_reason": null |
| 271 | }, |
| 272 | { |
| 273 | "description": "Homebrew cask example", |
| 274 | "test_group": "base", |
| 275 | "test_type": "parse", |
| 276 | "input": "pkg:brew/homebrew/cask/[email protected]", |
| 277 | "expected_output": { |
| 278 | "type": "brew", |
| 279 | "namespace": "homebrew/cask", |
| 280 | "name": "firefox", |
| 281 | "version": "120.0", |
| 282 | "qualifiers": null, |
| 283 | "subpath": null |
| 284 | }, |
| 285 | "expected_failure": false, |
| 286 | "expected_failure_reason": null |
| 287 | }, |
| 288 | { |
| 289 | "description": "Homebrew cask example - roundtrip", |
| 290 | "test_group": "base", |
| 291 | "test_type": "roundtrip", |
| 292 | "input": "pkg:brew/homebrew/cask/[email protected]", |
| 293 | "expected_output": "pkg:brew/homebrew/cask/[email protected]", |
| 294 | "expected_failure": false, |
| 295 | "expected_failure_reason": null |
| 296 | } |
| 297 | ] |
| 298 | } |