mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +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=
|