mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Add #caller_location to check in fmt tests
This makes it much easier to track down which line failed.
This commit is contained in:
@@ -259,7 +259,7 @@ test_pointers :: proc(t: ^testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@(private)
|
@(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)
|
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)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user