Skip to content

docs: how to create invalid cases in the test-suite? #403

@jkowalleck

Description

@jkowalleck

test suite's purpose is defined as

- **is_invalid**: a boolean flag set to true if the test should report an
error
To test ``purl`` parsing and building, a tool can use this test suite and for
every listed test object, run these tests:
- parsing the test canonical ``purl`` then re-building a ``purl`` from these parsed
components should return the test canonical ``purl``
- parsing the test ``purl`` should return the components parsed from the test
canonical ``purl``
- parsing the test ``purl`` then re-building a ``purl`` from these parsed components
should return the test canonical ``purl``
- building a ``purl`` from the test components should return the test canonical ``purl``

@johnmhoran via #368 (comment):

thinking of some other test objects I've seen, must a canonical_purl be either null or a valid purl? Or another way to think about it: when is a canonical_purl null, and can it ever be an invalid purl (like https://github.com/package-url/purl-spec/blob/main/test-suite-data.json#L197)?

we are not certain how an invalid test must be structured.
sure, is_invalid must be true, but how about the other parts?

And we should find a consensus, and write guidelines for that.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions