Skip to content

Some spec tests are invalid for NPM #865

Description

@darkrift

According to NPM type spec, the @ used for the scope is supposed to be encoded, however, there are 2 tests expected to pass that actually pass the @ unencoded:

{
"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
},

Even the npm type spec mentions they are supposed to be percent encoded :

"note": "The namespace is used for the scope of a scoped NPM package. The npm scope @ sign prefix is always percent encoded, as it was in the early days of npm scope."

Is it expected and something is missing from the parsing spec or are those tests really invalid and should be either removed or modified to become valid ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions