These libraries are experimental. APIs may change without notice. Generated from source with koruc 0.1.7 on 9/16/2026.

Regressions

@korulang/regressions

v3 — SELF-DESCRIBING TESTS (inline `//~` annotations). A case is declared as:

regressions/index.kz · 9 tors· 1 internal

@korulang/regressions — a programmable, koru-native test/verification runner. · 54 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 come in TWO ADJACENT SPELLINGS, one vocabulary, one wall: the declared norun markers below (like `case`, collected from the test's own AST — the compiler parses, resolves, and validates them) and the //~ comment directives (ruled Lars 2026-07-17). Both feed the same validation and scoring; a file uses one spelling, never both. The comment form is also the only one that can score a frontend negative — a file that fails at the frontend never materializes its AST, so it cannot declare itself: ~koru/regressions:run() compile + run + exit 0 + no leaks ~koru/regressions:compile-fail(stage: backend) must fail, pinned to stage ~koru/regressions:error(id: "KORU030", msg: "…") pinned diagnostic (ID + substring) ~koru/regressions:expect(text: "…") produced-program output must contain it ~koru/regressions:expect-not(text: "…") produced-program output must NOT contain it ~koru/regressions:leaks-allow(reason: "…") opt out of the leak gate (reasoned) //~ run the same vocabulary, as comments //~ compile_fail(frontend|backend) //~ error[KORU030]: msg //~ expect: text / //~ expect-not: text //~ leaks: allow <reason> 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). HISTORY — a ledger (.koru-regressions/latest.json, gitignored) records the last COMPLETE run's verdicts; the board diffs against it (NEW / FIXED / REGRESSION) and a green→red flip — or any red — exits 1, so `koruc suite.k test` is an honest CI gate. SELECTION — case blocks may declare "category" and "tags" arrays; the invocation selects with --category/-c, --tag/-t, --smoke. Filtered runs never write the ledger (a partial board must not clobber history), and a filter matching nothing is refused, not silently green. Next: named line markers (@marker — blocked on backend diagnostics carrying real file:line), cross-backend parity (backends: zig js), result cache + parallelism, general run-recipe (pytest/cargo).

test

comptimecommand index.kz:65

score

comptimeabstract index.kz:427

case

comptimenorun index.kz:804

run

comptimenorun index.kz:834

compile-fail

comptimenorun index.kz:838

error

comptimenorun index.kz:842

expect

comptimenorun index.kz:846

expect-not

comptimenorun index.kz:850

leaks-allow

comptimenorun index.kz:854