This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 9/16/2026.
Testing.assert
~import std/testing.assertKoru Standard Library: the `assert` part of testing.kz.
testing.assert.kz · 5 tors
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
// 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
~[keyword|comptime|transform|pure] pub tor assert {
expr: Expression,
invocation: *const Invocation,
item: std/compiler:*const Item,
program: std/compiler:*const Program,
allocator: std.mem.Allocator
} -> SiteResult// Simple pass - marks a test branch as passing (noop)
~[keyword|comptime|transform|pure] pub tor assert.ok {}// Simple fail - fails the test with optional message
~[keyword] pub tor assert.fail { message: ?string }// Equality assertion
~[keyword] pub tor assert.eq { expected: Expression, actual: Expression }
| ok
| failed { expected: string, actual: string }// TODO: Transform to generate Zig equality check
//
// Contains assertion (for strings/slices)
~[keyword] pub tor assert.contains { haystack: Expression, needle: Expression }
| ok
| failed