This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 11/4/2026.

Testing

import std/testing

Koru Testing Framework

testing.kz · 10 tors · ~[comptime]

Koru Testing Framework · 16 more lines
Koru Testing Framework Compiler-guided test development with automatic mock detection. Usage: test(User cannot withdraw more than balance) { account.balance = amount 50 app:withdraw(amount: 100) | insufficient_funds |> assert.ok() } The compiler: 1. Traces the flow to find impure tors 2. Errors if impure tor not mocked 3. Errors if mock is unused 4. Generates Zig test block

test

keywordcomptimetransform koru_std/testing.kz:256

validate-mocks

comptimeretain koru_std/testing.kz:265

test.with-harness

keywordcomptimetransform koru_std/testing.kz:874

test.harness

keywordcomptimetransform koru_std/testing.kz:881

test.property.equivalent

comptimetransform koru_std/testing.kz:897

~part assert koru_std/testing.assert.kz

Koru Standard Library: the `assert` part of testing.kz. Joined via `~part assert` in testing.kz; merged into the testing module at load. Assertions Pass-through assertion checkpoint Usage: assert(u.name == "Alice") |> next_step() Panics with message if expression is false, otherwise continues

assert

keywordcomptimetransformpure koru_std/testing.assert.kz:11

assert.ok

keywordcomptimetransformpure koru_std/testing.assert.kz:78

assert.fail

keyword koru_std/testing.assert.kz:86

~part compare koru_std/testing.compare.kz

Koru Standard Library: the `compare` part of testing.kz. Joined via `~part compare`; merged into the testing module at load. Equality assertion

assert.eq

keywordcomptimetransformpure koru_std/testing.compare.kz:5

assert.contains

keywordcomptimetransformpure koru_std/testing.compare.kz:70