| 1 | { |
| 2 | "$schema": "https://packageurl.org/schemas/purl-test.schema-0.1.json", |
| 3 | "tests": [ |
| 4 | { |
| 5 | "description": "Parse test for PURL type: hex", |
| 6 | "test_group": "base", |
| 7 | "test_type": "parse", |
| 8 | "input": "pkg:hex/[email protected]", |
| 9 | "expected_output": { |
| 10 | "type": "hex", |
| 11 | "namespace": null, |
| 12 | "name": "jason", |
| 13 | "version": "1.1.2", |
| 14 | "qualifiers": null, |
| 15 | "subpath": null |
| 16 | }, |
| 17 | "expected_failure": false, |
| 18 | "expected_failure_reason": null |
| 19 | }, |
| 20 | { |
| 21 | "description": "Roundtrip test for PURL type: hex", |
| 22 | "test_group": "base", |
| 23 | "test_type": "roundtrip", |
| 24 | "input": "pkg:hex/[email protected]", |
| 25 | "expected_output": "pkg:hex/[email protected]", |
| 26 | "expected_failure": false, |
| 27 | "expected_failure_reason": null |
| 28 | }, |
| 29 | { |
| 30 | "description": "Build test for PURL type: hex", |
| 31 | "test_group": "base", |
| 32 | "test_type": "build", |
| 33 | "input": { |
| 34 | "type": "hex", |
| 35 | "namespace": null, |
| 36 | "name": "jason", |
| 37 | "version": "1.1.2", |
| 38 | "qualifiers": null, |
| 39 | "subpath": null |
| 40 | }, |
| 41 | "expected_output": "pkg:hex/[email protected]", |
| 42 | "expected_failure": false, |
| 43 | "expected_failure_reason": null |
| 44 | }, |
| 45 | { |
| 46 | "description": "Parse test for PURL type: hex", |
| 47 | "test_group": "base", |
| 48 | "test_type": "parse", |
| 49 | "input": "pkg:hex/acme/[email protected].", |
| 50 | "expected_output": { |
| 51 | "type": "hex", |
| 52 | "namespace": "acme", |
| 53 | "name": "foo", |
| 54 | "version": "2.3.", |
| 55 | "qualifiers": null, |
| 56 | "subpath": null |
| 57 | }, |
| 58 | "expected_failure": false, |
| 59 | "expected_failure_reason": null |
| 60 | }, |
| 61 | { |
| 62 | "description": "Roundtrip test for PURL type: hex", |
| 63 | "test_group": "base", |
| 64 | "test_type": "roundtrip", |
| 65 | "input": "pkg:hex/acme/[email protected].", |
| 66 | "expected_output": "pkg:hex/acme/[email protected].", |
| 67 | "expected_failure": false, |
| 68 | "expected_failure_reason": null |
| 69 | }, |
| 70 | { |
| 71 | "description": "Build test for PURL type: hex", |
| 72 | "test_group": "base", |
| 73 | "test_type": "build", |
| 74 | "input": { |
| 75 | "type": "hex", |
| 76 | "namespace": "acme", |
| 77 | "name": "foo", |
| 78 | "version": "2.3.", |
| 79 | "qualifiers": null, |
| 80 | "subpath": null |
| 81 | }, |
| 82 | "expected_output": "pkg:hex/acme/[email protected].", |
| 83 | "expected_failure": false, |
| 84 | "expected_failure_reason": null |
| 85 | }, |
| 86 | { |
| 87 | "description": "Parse test for PURL type: hex", |
| 88 | "test_group": "base", |
| 89 | "test_type": "parse", |
| 90 | "input": "pkg:hex/[email protected]#priv/static/phoenix_html.js", |
| 91 | "expected_output": { |
| 92 | "type": "hex", |
| 93 | "namespace": null, |
| 94 | "name": "phoenix_html", |
| 95 | "version": "2.13.3", |
| 96 | "qualifiers": null, |
| 97 | "subpath": "priv/static/phoenix_html.js" |
| 98 | }, |
| 99 | "expected_failure": false, |
| 100 | "expected_failure_reason": null |
| 101 | }, |
| 102 | { |
| 103 | "description": "Roundtrip test for PURL type: hex", |
| 104 | "test_group": "base", |
| 105 | "test_type": "roundtrip", |
| 106 | "input": "pkg:hex/[email protected]#priv/static/phoenix_html.js", |
| 107 | "expected_output": "pkg:hex/[email protected]#priv/static/phoenix_html.js", |
| 108 | "expected_failure": false, |
| 109 | "expected_failure_reason": null |
| 110 | }, |
| 111 | { |
| 112 | "description": "Build test for PURL type: hex", |
| 113 | "test_group": "base", |
| 114 | "test_type": "build", |
| 115 | "input": { |
| 116 | "type": "hex", |
| 117 | "namespace": null, |
| 118 | "name": "phoenix_html", |
| 119 | "version": "2.13.3", |
| 120 | "qualifiers": null, |
| 121 | "subpath": "priv/static/phoenix_html.js" |
| 122 | }, |
| 123 | "expected_output": "pkg:hex/[email protected]#priv/static/phoenix_html.js", |
| 124 | "expected_failure": false, |
| 125 | "expected_failure_reason": null |
| 126 | }, |
| 127 | { |
| 128 | "description": "Parse test for PURL type: hex", |
| 129 | "test_group": "base", |
| 130 | "test_type": "parse", |
| 131 | "input": "pkg:hex/[email protected]?repository_url=https://myrepo.example.com", |
| 132 | "expected_output": { |
| 133 | "type": "hex", |
| 134 | "namespace": null, |
| 135 | "name": "bar", |
| 136 | "version": "1.2.3", |
| 137 | "qualifiers": { |
| 138 | "repository_url": "https://myrepo.example.com" |
| 139 | }, |
| 140 | "subpath": null |
| 141 | }, |
| 142 | "expected_failure": false, |
| 143 | "expected_failure_reason": null |
| 144 | }, |
| 145 | { |
| 146 | "description": "Roundtrip test for PURL type: hex", |
| 147 | "test_group": "base", |
| 148 | "test_type": "roundtrip", |
| 149 | "input": "pkg:hex/[email protected]?repository_url=https://myrepo.example.com", |
| 150 | "expected_output": "pkg:hex/[email protected]?repository_url=https:%2F%2Fmyrepo.example.com", |
| 151 | "expected_failure": false, |
| 152 | "expected_failure_reason": null |
| 153 | }, |
| 154 | { |
| 155 | "description": "Build test for PURL type: hex", |
| 156 | "test_group": "base", |
| 157 | "test_type": "build", |
| 158 | "input": { |
| 159 | "type": "hex", |
| 160 | "namespace": null, |
| 161 | "name": "bar", |
| 162 | "version": "1.2.3", |
| 163 | "qualifiers": { |
| 164 | "repository_url": "https://myrepo.example.com" |
| 165 | }, |
| 166 | "subpath": null |
| 167 | }, |
| 168 | "expected_output": "pkg:hex/[email protected]?repository_url=https:%2F%2Fmyrepo.example.com", |
| 169 | "expected_failure": false, |
| 170 | "expected_failure_reason": null |
| 171 | } |
| 172 | ] |
| 173 | } |