This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 8/19/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 events 2. Errors if impure event 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:846

test.harness

keywordcomptimetransform koru_std/testing.kz:853

assert

keywordcomptimetransformpure koru_std/testing.kz:865

assert.ok

keywordcomptimetransformpure koru_std/testing.kz:933

assert.fail

keyword koru_std/testing.kz:941

assert.eq

keyword koru_std/testing.kz:949

assert.contains

keyword koru_std/testing.kz:956

test.property.equivalent

comptimetransform koru_std/testing.kz:971