mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-20 00:16:47 +00:00
Add testing.fail_now
This commit is contained in:
@@ -25,6 +25,8 @@ T :: struct {
|
||||
w: io.Writer,
|
||||
|
||||
cleanups: [dynamic]Internal_Cleanup,
|
||||
|
||||
_fail_now: proc() -> !,
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +48,13 @@ fail :: proc(t: ^T) {
|
||||
t.error_count += 1;
|
||||
}
|
||||
|
||||
fail_now :: proc(t: ^T) {
|
||||
fail(t);
|
||||
if t._fail_now != nil {
|
||||
t._fail_now();
|
||||
}
|
||||
}
|
||||
|
||||
failed :: proc(t: ^T) -> bool {
|
||||
return t.error_count != 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user