ref: 90c065621cb9245e996dd379270ffa7c277d13db
parent: eb21d4f1381f73045c81df0840aa50df20515045
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Jun 13 19:18:37 EDT 2016
Show failure message in output.
--- a/mbld/subtest.myr
+++ b/mbld/subtest.myr
@@ -82,10 +82,10 @@
match testfoot(ln)
| `std.None:
| `std.Some `std.Ok _:
- endtest(&curtest, &nresults, true)
+ endtest(&curtest, &nresults, true, "")
continue
| `std.Some `std.Fail m:
- endtest(&curtest, &nresults, false)
+ endtest(&curtest, &nresults, false, m)
ok = false
continue
;;
@@ -116,7 +116,7 @@
curtest# = t
}
-const endtest = {curtest, nresults, pass
+const endtest = {curtest, nresults, pass, msg
if curtest#.len == 0
std.fatal("malformed input: test ended without start\n")
;;
@@ -124,6 +124,8 @@
curtest# = ""
if pass
std.put("PASS\n")
+ elif msg.len > 0
+ std.put("FAIL {}\n", msg)
else
std.put("FAIL\n")
;;