To support the language-neutral testing of purl implementations, a test
suite is provided as JSON document named test-suite-data.json. This JSON
document contains an array of objects. Each object represents a test with
these key/value pairs some of which may not be normalized:
- purl: a
purlstring. - canonical: the same
purlstring in canonical, normalized form - type: the
typecorresponding to thispurl. - namespace: the
namespacecorresponding to thispurl. - name: the
namecorresponding to thispurl. - version: the
versioncorresponding to thispurl. - qualifiers: the
qualifierscorresponding to thispurlas an object of {key: value} qualifier pairs. - subpath: the
subpathcorresponding to thispurl. - 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
purlthen re-building apurlfrom these parsed components should return the test canonicalpurl -
parsing the test
purlshould return the components parsed from the test canonicalpurl -
parsing the test
purlthen re-building apurlfrom these parsed components should return the test canonicalpurl -
building a
purlfrom the test components should return the test canonicalpurl