mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
11 lines
236 B
Zig
11 lines
236 B
Zig
// This is how std.debug.assert is implemented
|
|
fn assert(ok: bool) void {
|
|
if (!ok) unreachable; // assertion failure
|
|
}
|
|
|
|
// This test will fail because we hit unreachable.
|
|
test "this will fail" {
|
|
assert(false);
|
|
}
|
|
|
|
// test_error=
|