mirror of
https://github.com/ziglang/zig.git
synced 2025-12-30 18:13:19 +00:00
14 lines
173 B
Zig
14 lines
173 B
Zig
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);
|
|
}
|