zig/test/self_hosted2.zig

14 lines
173 B
Zig
Raw Normal View History

fn add(a: i32, b: i32) -> i32 {
a + b
}
fn assert(ok: bool) {
if (!ok) @unreachable();
}
fn testAdd() {
@setFnTest(this, true);
assert(add(2, 3) == 5);
}