diff options
| author | gingerBill <bill@gingerbill.org> | 2023-06-21 01:17:05 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-06-21 01:17:05 +0100 |
| commit | 9b54b99bf696a65bc5c8358b2a5ace1f6dc4fdcc (patch) | |
| tree | 1e20f43aa33209caf9015d9b63384633eed455a4 /core/testing/testing.odin | |
| parent | 67ca9166d36375fd42725c16ca3933d4c91ebfee (diff) | |
Use positional and named arguments within the core library
Diffstat (limited to 'core/testing/testing.odin')
| -rw-r--r-- | core/testing/testing.odin | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/testing/testing.odin b/core/testing/testing.odin index 37f9fe4d9..0ceb58e33 100644 --- a/core/testing/testing.odin +++ b/core/testing/testing.odin @@ -46,15 +46,15 @@ errorf :: proc(t: ^T, format: string, args: ..any, loc := #caller_location) { } fail :: proc(t: ^T, loc := #caller_location) { - error(t=t, args={"FAIL"}, loc=loc) + error(t, "FAIL", loc=loc) t.error_count += 1 } fail_now :: proc(t: ^T, msg := "", loc := #caller_location) { if msg != "" { - error(t=t, args={"FAIL:", msg}, loc=loc) + error(t, "FAIL:", msg, loc=loc) } else { - error(t=t, args={"FAIL"}, loc=loc) + error(t, "FAIL", loc=loc) } t.error_count += 1 if t._fail_now != nil { @@ -84,14 +84,14 @@ cleanup :: proc(t: ^T, procedure: proc(rawptr), user_data: rawptr) { expect :: proc(t: ^T, ok: bool, msg: string = "", loc := #caller_location) -> bool { if !ok { - error(t=t, args={msg}, loc=loc) + error(t, msg, loc=loc) } return ok } expect_value :: proc(t: ^T, value, expected: $T, loc := #caller_location) -> bool where intrinsics.type_is_comparable(T) { ok := value == expected if !ok { - errorf(t=t, format="expected %v, got %v", args={expected, value}, loc=loc) + errorf(t, "expected %v, got %v", expected, value, loc=loc) } return ok } |