VERS test definition

Type: object

Schema for Version Range Specifier tests definitions.

No Additional Properties

JSON schema

Type: objectFormat: uri

Contains the URL of the JSON schema for Version Range Specifier tests.

Test suite

Type: array

A list of Version Range Specifier tests.

Must contain a minimum of 1 items

All items must be unique

No Additional Items

Each item of this array must be:

VERS test

Type: object

A VERS test with input and expected output.

Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: "from_native"

Type: const
Specific value: false
Type: object

Input for conversion from native version range to VERS

Type: object

An object with a data source and native version range data to use as conversion test from native data.

The following properties are required:

  • scheme

Data source for test input

Type: string

A string (like a scheme or else) or URL that identifies the source of the data for this test input.


Examples:

"https://github.com/npm/node-semver#ranges"
"https://gitlab.com/gitlab-org/advisories-community/-/tree/main/packagist"
"https://gitlab.com/gitlab-org/advisories-community/-/tree/main/go"
"https://git.alpinelinux.org/apk-tools/tree/test/unit/version.data"
"https://github.com/rpm-software-management/rpm/blob/master/tests/rpmvercmp.at"

Input native version range

Type: string, object or array

A native version range data that can be any of a string, array or object.

Expected canonical VERS

Type: string

A canonical VERS string to use as a test ouput.

Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: "parse"

Type: const
Specific value: false
Type: object

Input test VERS

Type: string

A VERS string to use as a test input (canonical or not).

Expected output decoded VERS components

Type: object

Test output as an object decoded VERS components.

VERS scheme

Type: string

A versioning scheme.


Examples:

"maven"
"npm"
"pypi"
"semver"

Version constraints list

Type: array

A list of version constraints as two-tuples of (comparator, version).

Must contain a minimum of 1 items

All items must be unique

No Additional Items

Each item of this array must be:

VERS version constraint

Type: array

A VERS version constraint as two-tuple array of (comparator, version string).

Must contain a minimum of 2 items

Must contain a maximum of 2 items

No Additional Items

Tuple Validation

Item at 1 must be:

VERS comparator

Type: enum (of string)

A VERS version comparator.

Must be one of:

  • ""
  • "*"
  • "="
  • "!="
  • ">="
  • ">"
  • "<="
  • "<"
Item at 2 must be:

Version

Type: string

A version string.


Examples:

"1.2.3"
"54.a-RELEASE"
Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: "build"

Type: const
Specific value: false
Type: object

Input decoded VERS components

Type: object

Test input as an object of decoded VERS components.

VERS scheme

Type: string

A versioning scheme.


Examples:

"maven"
"npm"
"pypi"
"semver"

Version constraints list

Type: array

A list of version constraints as two-tuples of (comparator, version).

Must contain a minimum of 1 items

All items must be unique

No Additional Items

Each item of this array must be:

VERS version constraint

Type: array

A VERS version constraint as two-tuple array of (comparator, version string).

Must contain a minimum of 2 items

Must contain a maximum of 2 items

No Additional Items

Tuple Validation

Item at 1 must be:

VERS comparator

Type: enum (of string)

A VERS version comparator.

Must be one of:

  • ""
  • "*"
  • "="
  • "!="
  • ">="
  • ">"
  • "<="
  • "<"
Item at 2 must be:

Version

Type: string

A version string.


Examples:

"1.2.3"
"54.a-RELEASE"

Expected canonical VERS

Type: string

A canonical VERS string to use as a test ouput.

Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: "roundtrip"
Type: object

Input test VERS

Type: string

A VERS string to use as a test input (canonical or not).

Expected canonical VERS

Type: string

A canonical VERS string to use as a test ouput.

Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: "merge"

Type: const
Specific value: false
Type: object

Input list of VERS strings

Type: array of string

Test input as a list of VERS strings.

Must contain a minimum of 1 items

All items must be unique

No Additional Items

Each item of this array must be:

Type: string

Expected canonical VERS

Type: string

An expected canonical merged VERS string to use as a test ouput.

Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: "containment"

Type: const
Specific value: false
Type: object

Input for version containment

Type: object

A version and a VERS string to use as a containment test input.

Input test version

Type: string

A version string to for containment in the input VERS.

Input test VERS

Type: string

A canonical VERS string used to test its containmant of the input version.

True if the version is expected to be contained in the input VERS

Type: boolean

A true boolean if the version is contained in the input VERS or false otherwise.

Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: "comparison"

Type: const
Specific value: false
Type: object

Input for version comparison

Type: object

A VERS scheme and a list of version strings to use as sorting test input.

The following properties are required:

  • scheme

VERS scheme

Type: string

A versioning scheme.

Input list of bare versions

Type: array of string

Test input as a list of bare versions strings.

Must contain a minimum of 2 items

No Additional Items

Each item of this array must be:

Type: string

Expected sorted list of bare versions

Type: array of string

An expected sorted list of version strings to use as a test ouput.

Must contain a minimum of 2 items

No Additional Items

Each item of this array must be:

Type: string
Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: "equality"

Type: const
Specific value: false
Type: object

Input for version equality

Type: object

A VERS scheme and a two-tuple of version strings to compare.

The following properties are required:

  • scheme

VERS scheme

Type: string

A versioning scheme.

Input tuple of two bare versions

Type: array of string

Test input as a tuple of two bare versions strings.

Must contain a minimum of 2 items

Must contain a maximum of 2 items

No Additional Items

Each item of this array must be:

Type: string

True if two bare versions are expected to be equal

Type: boolean

A true boolean if two bare versions are expected to be equal to use as a test ouput.

Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: "parse"

Type: const
Specific value: true
Type: object

The following properties are required:

  • expected_failure_reason

Input test VERS

Type: string

A VERS string to use as a test input (canonical or not).

Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: "build"

Type: const
Specific value: true
Type: object

The following properties are required:

  • expected_failure_reason

Input VERS components

Type: object

Test input as an object of decoded VERS components.

VERS scheme

Type: string

A versioning scheme.


Examples:

"maven"
"npm"
"pypi"
"semver"

Version constraints list

Type: array

A list of version constraints as two-tuples of (comparator, version).

Must contain a minimum of 1 items

All items must be unique

No Additional Items

Each item of this array must be:

VERS version constraint

Type: array

A VERS version constraint as two-tuple array of (comparator, version string).

Must contain a minimum of 2 items

Must contain a maximum of 2 items

No Additional Items

Tuple Validation

Item at 1 must be:

VERS comparator

Type: enum (of string)

A VERS version comparator.

Must be one of:

  • ""
  • "*"
  • "="
  • "!="
  • ">="
  • ">"
  • "<="
  • "<"
Item at 2 must be:

Version

Type: string

A version string.


Examples:

"1.2.3"
"54.a-RELEASE"

The following properties are required:

  • input

Test description

Type: string

A description for this test.

Test group

Type: enum (of string)

The group of this test like 'base' or 'advanced'.

Must be one of:

  • "base" :

    Test group for base conformance tests for VERS building and parsing.

  • "advanced" :

    Test group for advanced tests to support flexible VERS building and parsing.

Test type

Type: enum (of string)

The type of this test like 'build' or 'parse'.

Must be one of:

  • "from_native" :

    A VERS construction test from native ecosystem range data input from a data source to a canonical VERS string.

  • "parse" :

    A VERS parsing test from a VERS string to decoded scheme and constraints list.

  • "build" :

    A VERS building test from decoded components to a canonical VERS string.

  • "roundtrip" :

    A VERS roundtrip test, parsing then building back a VERS from a canonical string input.

  • "merge" :

    A VERS merging test from an array of VERS strings to a canonical VERS string.

  • "containment" :

    A VERS containment to test if a bare version string is contained in the range of a VERS string.

  • "invert" :

    A VERS inversion of a VERS string to a canonical VERS string.

  • "comparison" :

    A version comparison test to sort an input version strings array using the scheme rules.

  • "equality" :

    A version equality test to check if two input versions strings are equal using the scheme rules.

Expected failure

Type: boolean Default: false

true if this test input is expected to fail to be processed.

Expected failure reason

Type: string or null Default: null

The reason why this test is is expected to fail if expected_failure is true.