mirror of
https://github.com/ziglang/zig.git
synced 2024-11-26 23:22:44 +00:00
12 lines
236 B
Zig
12 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=
|