Skip to content

Capabilities

The conformance suite includes optional features — behaviors that a runner may choose to support or skip. Rather than scattering "skip if unsupported" prose throughout individual fixture descriptions, the suite uses a formal capabilities declaration: a runner declares which optional features it implements, and the dispatch layer skips cases that require an undeclared feature automatically.

Available capabilities

Capability Meaning
jsPath Supports kPointer's JavaScript access path extension — parsing jsPath input strings and producing jsPath output

The requiresCapability fixture field

Any case in any fixture file may carry a top-level requiresCapability field:

{
  "name": "root-from-js-path",
  "requiresCapability": "jsPath",
  "input": "",
  "encoding": "jsPath",
  "expect": {  }
}

When a runner encounters a case whose requiresCapability names a feature the runner has not declared, the case is skipped — not run, not counted as pass or fail. Cases without requiresCapability are mandatory for all runners.

Advisory output fields

Some output fields are also gated on a capability even for cases that do run. When the relevant capability is absent, the field is present in the fixture JSON but the runner omits that particular check:

Field Capability Fixture
jsPath jsPath syntax/parsing success expectations

This lets a runner that supports RFC 6901 and fragment encodings — but not the JavaScript access path — run the full parsing suite and verify all normative fields, skipping only the advisory jsPath output check.

Using the Kotlin reference implementation

ConformanceCapabilities declares which features the runner supports. All capabilities default to true; ConformanceCapabilities.ALL is a pre-built all-enabled instance.

// Declare support for all optional features (the default)
val capabilities = ConformanceCapabilities.ALL

// Declare no support for the JavaScript access path
val noJsPath = ConformanceCapabilities(jsPath = false)

// Dispatch with a capabilities object
val result = ConformanceDispatcher.dispatch(fixtureJson, noJsPath)

Cases tagged with an unmet requiresCapability are returned as ConformanceResult.Skipped.

CLI usage

The kpointer conformance command exposes capability flags. See the CLI Reference for the full option list, output format, and exit codes. The capability-relevant flag is:

Flag Effect
--no-js-path Cases that require jsPath are skipped; the summary reports the skipped count.

Implementing capability gating in a custom runner

If you are writing a runner in another language, add capability gating in your fixture loop:

  1. Choose which capabilities your implementation supports.
  2. Before running a case, check whether it has a requiresCapability field.
  3. If it does and you have not declared that capability, record the case as skipped and move on — do not run it, and do not count it as a pass or a failure.
  4. For cases you do run, suppress any advisory output-field checks (such as the jsPath field) when the corresponding capability is absent.