Home / Docs / Una for agents / Schemas

una.test/2

Release v0.4.0

una.test/2 is a JSON document of the Agent ABI, defined in spec/13 §5. This page gathers what the specification says about it at v0.4.0: each section whole where it opens with the document, and otherwise the parts that name it.

Command line

From spec/13 §5, the parts that name this schema.

una test [path] prints, in human mode, one line per example on stdout, example <module> "<name>" ... ok or ... FAILED, followed for a failed example by the file, line and text of the expectation to blame, when there is one, and the reason; then a blank line and <n> examples: <p> passed, <f> failed. It exits with code 1 when an example fails. With --json it prints {"schema":"una.test/1","tier":...,"diagnostics":[...],"examples":[...],"passed":p,"failed":f}: diagnostics holds the errors of the checks when nothing ran, or U6003 and U8001 of aborted examples; each example has module, name, outcome (pass or fail), reason (null, or why it fails), expectation (null, or {"file":...,"line":...,"text":...}), result ({"kind":"ok","value":...}, {"kind":"fail","variant":...,"value":...} or {"kind":"aborted"}) and trace (spec/11 §5). (v0.2, ADR 0078.) The document also holds redacted, after tier: true when the results and reasons of its examples redact labeled fields, as in a package of edition 0.1, and false when they show every field, as in a package of edition 0.2 (spec/11 §5). The key is additive, and the schema stays una.test/1. (v0.3, ADR 0105.) For a package of edition 0.3 or later, where the declaration is written test, each line reads test <module> "<name>" ... ok or ... FAILED and the summary <n> tests: <p> passed, <f> failed, and --json prints {"schema":"una.test/2","tier":...,"redacted":...,"diagnostics":[...],"tests":[...],"passed":p,"failed":f}, the schema una.test/2: the document of una.test/1 with the key examples renamed tests, holding the same objects in the same order with the same keys. Packages of editions 0.1 and 0.2 keep una.test/1 byte for byte. A consumer that reads both dispatches on schema.