Files
aji/tests/conformance/README.md
T
dev 17a55a7fef Initial import: Aji 0.1 draft spec and Zig scaffolding
Draft specification, RFCs, reference registries and examples, plus the
reference-implementation skeleton: build.zig, diagnostic envelope with
error-code registry synced to docs, aji CLI, conformance runner with seed
tests, CI and contributor docs.
2026-10-04 11:59:13 +03:00

43 lines
1.7 KiB
Markdown

# Conformance suite
Run with `zig build conformance` (add `-- --json` for JSON Lines, `-- --filter <substring>` to narrow).
## Layout
```text
tests/conformance/
phase<N>/accept/*.air modules a conforming verifier MUST accept
phase<N>/reject/*.air modules a conforming verifier MUST reject
```
`phase<N>` is the roadmap phase (`docs/roadmap/implementation-plan.md`) that first requires the test to pass.
## Test header
Every test starts with a block of `;` lines. Keys:
| Key | Required | Value |
|---|---|---|
| `expect` | yes | `accept`, or `reject` followed by one or more codes from `docs/reference/error-codes.md` |
| `phase` | yes | roadmap phase number |
| `spec` | yes | spec section that justifies the expectation |
Header lines without a `key:` are free-form description. The runner blanks the header before handing the module to the pipeline, so line numbers in diagnostics are unchanged and the AIR grammar does not need to know about test metadata.
`reject` compares the exact multiset of error codes. Listing a code twice means two diagnostics with that code are expected.
## Outcomes
| Outcome | Meaning |
|---|---|
| `PASS` | result matches `expect` |
| `FAIL` | result differs, or the header is malformed; the run exits 1 |
| `PENDING` | the pipeline stage needed for this input is not implemented yet |
## Rules
- Every verifier rule gets at least one `accept` and one `reject` test (AGENTS.md, testing policy).
- One defect per `reject` test. A test that triggers several unrelated errors is hard to repair against.
- Keep tests minimal: the smallest module that exhibits the rule.
- Text AIR syntax in the seed tests is provisional until the text AIR grammar is specified (Phase 0, task P0-1). Update the tests when the grammar lands.