shithub: mc

Download patch

ref: 1ac88fcd0d2f000dac2119cf52e3bd7c60200b96
parent: e1bfd3ee239d17bd45b7cc2caa671a91e0774304
author: Ori Bernstein <[email protected]>
date: Tue May 1 06:24:28 EDT 2018

Escape test failures.

	This makes things work more good when running tests
	by hand.

--- a/lib/testr/testr.myr
+++ b/lib/testr/testr.myr
@@ -59,14 +59,24 @@
 }
 
 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))
 	;;
 }
 
--- a/mbld/subtest.myr
+++ b/mbld/subtest.myr
@@ -191,7 +191,7 @@
 
 	p = std.pathcat(cmd, curtest#)
 	donetest(b, curtest, nresults)
-	mbldput("FAIL {}\n", msg)
+	mbldput("FAIL {e}\n", msg)
 	std.slpush(failed, p)
 }