{ "$schema": "https://packageurl.org/schemas/purl-test.schema-0.1.json", "tests": [ { "description": "npm can be scoped. Roundtrip an input purl to canonical.", "test_group": "advanced", "test_type": "roundtrip", "input": "pkg:npm/%40angular/animation@12.3.1", "expected_output": "pkg:npm/%40angular/animation@12.3.1", "expected_failure": false, "expected_failure_reason": null }, { "description": "npm can be scoped", "test_group": "base", "test_type": "parse", "input": "pkg:npm/%40angular/animation@12.3.1", "expected_output": { "type": "npm", "namespace": "@angular", "name": "animation", "version": "12.3.1", "qualifiers": null, "subpath": null }, "expected_failure": false, "expected_failure_reason": null }, { "description": "npm can be scoped. Roundtrip a canonical input to canonical output.", "test_group": "base", "test_type": "roundtrip", "input": "pkg:npm/%40angular/animation@12.3.1", "expected_output": "pkg:npm/%40angular/animation@12.3.1", "expected_failure": false, "expected_failure_reason": null }, { "description": "npm can be scoped", "test_group": "base", "test_type": "build", "input": { "type": "npm", "namespace": "@angular", "name": "animation", "version": "12.3.1", "qualifiers": null, "subpath": null }, "expected_output": "pkg:npm/%40angular/animation@12.3.1", "expected_failure": false, "expected_failure_reason": null }, { "description": "Parse test for PURL type: npm", "test_group": "base", "test_type": "parse", "input": "pkg:npm/foobar@12.3.1", "expected_output": { "type": "npm", "namespace": null, "name": "foobar", "version": "12.3.1", "qualifiers": null, "subpath": null }, "expected_failure": false, "expected_failure_reason": null }, { "description": "Roundtrip test for PURL type: npm", "test_group": "base", "test_type": "roundtrip", "input": "pkg:npm/foobar@12.3.1", "expected_output": "pkg:npm/foobar@12.3.1", "expected_failure": false, "expected_failure_reason": null }, { "description": "Build test for PURL type: npm", "test_group": "base", "test_type": "build", "input": { "type": "npm", "namespace": null, "name": "foobar", "version": "12.3.1", "qualifiers": null, "subpath": null }, "expected_output": "pkg:npm/foobar@12.3.1", "expected_failure": false, "expected_failure_reason": null }, { "description": "Parse test for PURL type: npm", "test_group": "base", "test_type": "parse", "input": "pkg:npm/%40angular/animation@12.3.1", "expected_output": { "type": "npm", "namespace": "@angular", "name": "animation", "version": "12.3.1", "qualifiers": null, "subpath": null }, "expected_failure": false, "expected_failure_reason": null }, { "description": "Roundtrip test for PURL type: npm", "test_group": "base", "test_type": "roundtrip", "input": "pkg:npm/%40angular/animation@12.3.1", "expected_output": "pkg:npm/%40angular/animation@12.3.1", "expected_failure": false, "expected_failure_reason": null }, { "description": "Build test for PURL type: npm", "test_group": "base", "test_type": "build", "input": { "type": "npm", "namespace": "@angular", "name": "animation", "version": "12.3.1", "qualifiers": null, "subpath": null }, "expected_output": "pkg:npm/%40angular/animation@12.3.1", "expected_failure": false, "expected_failure_reason": null }, { "description": "Parse test for PURL type: npm", "test_group": "base", "test_type": "parse", "input": "pkg:npm/mypackage@12.4.5?vcs_url=git://host.com/path/to/repo.git%404345abcd34343", "expected_output": { "type": "npm", "namespace": null, "name": "mypackage", "version": "12.4.5", "qualifiers": { "vcs_url": "git://host.com/path/to/repo.git@4345abcd34343" }, "subpath": null }, "expected_failure": false, "expected_failure_reason": null }, { "description": "Roundtrip test for PURL type: npm", "test_group": "base", "test_type": "roundtrip", "input": "pkg:npm/mypackage@12.4.5?vcs_url=git://host.com/path/to/repo.git%404345abcd34343", "expected_output": "pkg:npm/mypackage@12.4.5?vcs_url=git:%2F%2Fhost.com%2Fpath%2Fto%2Frepo.git%404345abcd34343", "expected_failure": false, "expected_failure_reason": null }, { "description": "Build test for PURL type: npm", "test_group": "base", "test_type": "build", "input": { "type": "npm", "namespace": null, "name": "mypackage", "version": "12.4.5", "qualifiers": { "vcs_url": "git://host.com/path/to/repo.git@4345abcd34343" }, "subpath": null }, "expected_output": "pkg:npm/mypackage@12.4.5?vcs_url=git:%2F%2Fhost.com%2Fpath%2Fto%2Frepo.git%404345abcd34343", "expected_failure": false, "expected_failure_reason": null }, { "description": "valid npm purl without version and with subpath, scope unencoded", "test_group": "advanced", "test_type": "roundtrip", "input": "pkg:npm/@babel/core#/googleapis/api/annotations/", "expected_output": "pkg:npm/%40babel/core#googleapis/api/annotations", "expected_failure": false, "expected_failure_reason": null }, { "description": "valid npm purl without version and with subpath, scope unencoded", "test_group": "advanced", "test_type": "parse", "input": "pkg:npm/@babel/core#/googleapis/api/annotations/", "expected_output": { "type": "npm", "namespace": "@babel", "name": "core", "version": null, "qualifiers": null, "subpath": "googleapis/api/annotations" }, "expected_failure": false, "expected_failure_reason": null }, { "description": "valid npm purl without version and with subpath, scope unencoded", "test_group": "base", "test_type": "parse", "input": "pkg:npm/%40babel/core#/googleapis/api/annotations/", "expected_output": { "type": "npm", "namespace": "@babel", "name": "core", "version": null, "qualifiers": null, "subpath": "googleapis/api/annotations" }, "expected_failure": false, "expected_failure_reason": null }, { "description": "valid npm purl without namespace and with subpath", "test_group": "base", "test_type": "roundtrip", "input": "pkg:npm/core@2.0.1#/googleapis/api/annotations/", "expected_output": "pkg:npm/core@2.0.1#googleapis/api/annotations", "expected_failure": false, "expected_failure_reason": null } ] }