These libraries are experimental. APIs may change without notice. Generated from source with koruc 0.1.7 on 8/19/2026.
Regressions
@korulang/regressionsv3 — SELF-DESCRIBING TESTS (inline `//~` annotations). A case is declared as:
regressions/index.kz · 3 tors· 1 internal
@korulang/regressions — a programmable, koru-native test/verification runner. · 30 more lines
@korulang/regressions — a programmable, koru-native test/verification runner.
v3 — SELF-DESCRIBING TESTS (inline `//~` annotations). A case is declared as:
koru/regressions:case(gzip round-trip) {
"file": "gzip/tests/roundtrip.kz"
}
where the label is an `expr: Expression` and the body is a `source: Source`
carrying a JSON object (the same idiom koru itself uses for `flag.declare` /
`command.declare` / `deps.requires`). The `test` command collects these at
COMPILE TIME (same [comptime|command] mechanism as koru/docker), runs each
case through a `koruc` subprocess, and scores it. Zero koru-toolchain
changes — pure external orchestration.
EXPECTATIONS live INLINE in the test file itself (resolved fork — see
REGRESSIONS_RUNNER_DESIGN.md "v1 proposal"), as `//~` directives:
//~ run compile + run + exit 0 + no leaks
//~ compile_fail(frontend|backend) must fail, pinned to stage
//~ error[KORU030]: Phantom state mismatch pinned diagnostic (ID + substring)
//~ leaks: allow <reason> opt out of the leak gate (reasoned)
The suite stays pure composition (a case = a label + a file). A JSON "kind"
is retired and rejected with teaching. An unpinned compile_fail is itself a
failure. Leak gate is default-ON and overrides pass (same detection as
koru's run_regression.sh: the Zig GPA "memory address … leaked" report).
Next: named line markers (@marker — blocked on backend diagnostics carrying
real file:line), cross-backend parity (backends: zig js), category/tags
selection, snapshots + regression tracking, general run-recipe (pytest/cargo).
~[comptime|command] pub tor test {
program: *const Program,
allocator: __koru_std.mem.Allocator,
argv: []const []const u8
}// `run` — the OVERRIDABLE runner seam (abstract event, same pattern as
// compiler:coordinate). The default below scores a case by driving `koruc` as a
// subprocess; a user swaps the entire behavior with `~koru/regressions:run = …`
// (e.g. to run pytest/cargo, or to traverse a dependency graph). "Traverses
// stuff" today = one case; the seam is what a future graph-runner plugs into.
~[comptime|abstract] pub tor run {
dir: string,
base: string,
allocator: __koru_std.mem.Allocator
}
| passed
| failed string// The `case` marker: a declared test case, collected from the AST by `test`.
// `expr` = the human label; `source` = a JSON object block. Void at runtime.
~[comptime|norun] pub tor case { expr: Expression, source: Source }