authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-05-18 01:14:30 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-05-18 01:14:30 -07:00
logea811764400357a5b2e868f158c76ce08a769991
tree5bf0bd219ab7614d06937e0d74d6750137dc4e33
parentcd255f12edeb9a396afc6a44f88e6c224a8dc8e9

add assertLog


1 files changed, 5 insertions(+), 0 deletions(-)

src/lib.zig+5
...@@ -492,3 +492,8 @@ pub fn opslice(slice: anytype, index: usize) ?std.meta.Child(@TypeOf(slice)) {...@@ -492,3 +492,8 @@ pub fn opslice(slice: anytype, index: usize) ?std.meta.Child(@TypeOf(slice)) {
492 if (slice.len <= index) return null;492 if (slice.len <= index) return null;
493 return slice[index];493 return slice[index];
494}494}
495
496pub fn assertLog(ok: bool, message: string) void {
497 if (!ok) std.log.err("assertion failure: {s}", .{message});
498 if (!ok) unreachable; // assertion failure
499}