summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-05-01 10:24:28 -0700
committerOri Bernstein <ori@eigenstate.org>2018-05-01 10:27:04 -0700
commit1ac88fcd0d2f000dac2119cf52e3bd7c60200b96 (patch)
tree5692024b1e3478c4a0fe683bc85c22b335cab4af
parente1bfd3ee239d17bd45b7cc2caa671a91e0774304 (diff)
downloadmc-1ac88fcd0d2f000dac2119cf52e3bd7c60200b96.tar.gz
Escape test failures.
This makes things work more good when running tests by hand.
-rw-r--r--lib/testr/testr.myr14
-rw-r--r--mbld/subtest.myr2
2 files changed, 13 insertions, 3 deletions
diff --git a/lib/testr/testr.myr b/lib/testr/testr.myr
index 9d8c55f..4a087f3 100644
--- a/lib/testr/testr.myr
+++ b/lib/testr/testr.myr
@@ -59,14 +59,24 @@ const check = {ctx, cond, msg, args
}
generic eq = {ctx, a, b
+ var b0 : byte[128]
+ var b1 : byte[128]
+
if !std.eq(a, b)
- fail(ctx, "{} != {}\n", a, b)
+ fail(ctx, "{e} != {e}\n",
+ std.bfmt(b0[:], "{}", a),
+ std.bfmt(b1[:], "{}", b))
;;
}
generic neq = {ctx, a, b
+ var b0 : byte[128]
+ var b1 : byte[128]
+
if std.eq(a, b)
- fail(ctx, "{} != {}\n", a, b)
+ fail(ctx, "{e} != {e}\n",
+ std.bfmt(b0[:], "{}", a),
+ std.bfmt(b1[:], "{}", b))
;;
}
diff --git a/mbld/subtest.myr b/mbld/subtest.myr
index 7dfeb62..eb8acb4 100644
--- a/mbld/subtest.myr
+++ b/mbld/subtest.myr
@@ -191,7 +191,7 @@ const failtest = {b, cmd, curtest, failed, nresults, msg
p = std.pathcat(cmd, curtest#)
donetest(b, curtest, nresults)
- mbldput("FAIL {}\n", msg)
+ mbldput("FAIL {e}\n", msg)
std.slpush(failed, p)
}