Add #caller_location to check in fmt tests

This makes it much easier to track down which line failed.
This commit is contained in:
Feoramund
2024-06-07 16:08:37 -04:00
parent b65589d036
commit affd48c791
+2 -2
View File
@@ -259,7 +259,7 @@ test_pointers :: proc(t: ^testing.T) {
}
@(private)
check :: proc(t: ^testing.T, exp: string, format: string, args: ..any) {
check :: proc(t: ^testing.T, exp: string, format: string, args: ..any, loc := #caller_location) {
got := fmt.tprintf(format, ..args)
testing.expectf(t, got == exp, "(%q, %v): %q != %q", format, args, got, exp)
testing.expectf(t, got == exp, "(%q, %v): %q != %q", format, args, got, exp, loc = loc)
}