commit 989dddb3ffcb2c93d3be39c7ea0e5a452e181966
parent b8515b90e2076a24bff09366dc833cd6f33133e2
Author: Sebastian <sebastian@sebsite.pw>
Date: Wed, 17 May 2023 13:39:49 -0400
test: print abort_fixed failure location
Signed-off-by: Sebastian <sebastian@sebsite.pw>
Diffstat:
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/test/+test.ha b/test/+test.ha
@@ -98,8 +98,16 @@ export @symbol("__test_main") fn main() size = {
if (len(ctx.failures) > 0) {
fmt::println("Failures:")!;
for (let i = 0z; i < len(ctx.failures); i += 1) {
- fmt::printfln("{}: {}", ctx.failures[i].test,
- ctx.failures[i].reason.msg)!;
+ if (ctx.failures[i].reason.loc != "") {
+ fmt::printfln("{}: {}: {}",
+ ctx.failures[i].test,
+ ctx.failures[i].reason.loc,
+ ctx.failures[i].reason.msg)!;
+ } else {
+ fmt::printfln("{}: {}",
+ ctx.failures[i].test,
+ ctx.failures[i].reason.msg)!;
+ };
};
fmt::println()!;
};