Skip to content

verdict test

Run each inline test in an isolated scope, including fact changes and read-only query blocks with temporary facts and rules. Report predicate-set assertions and diagnostics.

Runs locally. Effects: none declared.

ArgumentTypeRequiredDefaultDescription
<file>positionalyesNo parser defaultPath to a .vd file containing inline tests
--jsonbooleannofalseOutput as JSON

--help (-h) shows command help without executing the command. Boolean flags support --no-<flag>. Defaults stated in descriptions may be resolved by the handler or configuration rather than the argument parser.

Required Verdict file path; stdin is unsupported.

File input: supported. Standard input: unsupported.

{
"kind": "json-schema",
"schema": {
"type": "object",
"required": [
"file",
"passed",
"tests",
"diagnostics"
],
"additionalProperties": false,
"properties": {
"file": {
"type": "string"
},
"passed": {
"type": "boolean"
},
"diagnostics": {
"type": "array",
"items": {
"type": "object",
"required": [
"position",
"message"
],
"additionalProperties": false,
"properties": {
"position": {
"type": "integer"
},
"message": {
"type": "string"
}
}
}
},
"tests": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"position",
"passed",
"results",
"assertions",
"diagnostics"
],
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"position": {
"type": "integer"
},
"passed": {
"type": "boolean"
},
"results": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"required": [
"label",
"predicate",
"rows"
],
"additionalProperties": false,
"properties": {
"label": {
"type": "string"
},
"predicate": {
"type": "string"
},
"rows": {
"type": "array",
"items": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "boolean"
},
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "object",
"required": [
"type",
"id"
],
"additionalProperties": false,
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"type",
"value"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "int64"
},
"value": {
"type": "string",
"pattern": "^-?[0-9]+$"
}
}
}
]
}
}
}
}
},
{
"type": "object",
"required": [
"label",
"bindings"
],
"additionalProperties": false,
"properties": {
"label": {
"type": "string"
},
"bindings": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": {
"anyOf": [
{
"type": "string"
},
{
"type": "boolean"
},
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "object",
"required": [
"type",
"id"
],
"additionalProperties": false,
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"type",
"value"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "int64"
},
"value": {
"type": "string",
"pattern": "^-?[0-9]+$"
}
}
}
]
}
}
}
}
}
]
}
},
"diagnostics": {
"type": "array",
"items": {
"type": "object",
"required": [
"position",
"message"
],
"additionalProperties": false,
"properties": {
"position": {
"type": "integer"
},
"message": {
"type": "string"
}
}
}
},
"assertions": {
"type": "array",
"items": {
"type": "object",
"required": [
"passed",
"comparison",
"negated",
"predicate",
"expected",
"actual",
"text",
"position"
],
"additionalProperties": false,
"properties": {
"passed": {
"type": "boolean"
},
"comparison": {
"type": "string",
"enum": [
"nonempty",
"equals",
"contains"
]
},
"negated": {
"type": "boolean"
},
"predicate": {
"type": "string"
},
"expected": {
"type": "array",
"items": {
"type": "object",
"required": [
"predicate",
"terms"
],
"additionalProperties": false,
"properties": {
"predicate": {
"type": "string"
},
"terms": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "boolean"
},
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "object",
"required": [
"type",
"id"
],
"additionalProperties": false,
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"type",
"value"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "int64"
},
"value": {
"type": "string",
"pattern": "^-?[0-9]+$"
}
}
}
]
}
}
}
}
},
"actual": {
"type": "array",
"items": {
"type": "object",
"required": [
"predicate",
"terms"
],
"additionalProperties": false,
"properties": {
"predicate": {
"type": "string"
},
"terms": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "boolean"
},
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "object",
"required": [
"type",
"id"
],
"additionalProperties": false,
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"type",
"value"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "int64"
},
"value": {
"type": "string",
"pattern": "^-?[0-9]+$"
}
}
}
]
}
}
}
}
},
"text": {
"type": "string"
},
"position": {
"type": "integer"
}
}
}
}
}
}
}
}
}
}

By default, the command renders human-readable records. --json writes one JSON result to stdout. Operational failures use status 1; JSON failures contain an error object with code and message. See shared output semantics.

  • 0: no diagnostics and every assertion passed, including files without inline tests.
  • 1: a source diagnostic, evaluation error, or failed assertion was reported.

Argument, I/O, and other failures handled by the CLI runner use status 1.

verdict test policy.vd --json