zig/test/cases/assert_function.16.zig

12 lines
169 B
Zig
Raw Normal View History

const hello = "hello".*;
pub fn main() void {
assert(hello[1] == 'e');
}
pub fn assert(ok: bool) void {
if (!ok) unreachable; // assertion failure
}
// run
//