[MLton-commit] r5921
Vesa Karvonen
vesak at mlton.org
Tue Aug 21 16:15:23 PDT 2007
Show exception history also with the all combinator.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/unit-test/unstable/detail/mk-unit-test.fun
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/unit-test/unstable/detail/mk-unit-test.fun
===================================================================
--- mltonlib/trunk/com/ssh/unit-test/unstable/detail/mk-unit-test.fun 2007-08-21 20:46:23 UTC (rev 5920)
+++ mltonlib/trunk/com/ssh/unit-test/unstable/detail/mk-unit-test.fun 2007-08-21 23:15:22 UTC (rev 5921)
@@ -140,6 +140,11 @@
(* TEST REGISTRATION INTERFACE *)
+ fun history e =
+ case Exn.history e
+ of [] => str "No exception history available"
+ | hs => indent (map str ("Exception history:"::hs))
+
fun test body =
runTest
(fn cfg =>
@@ -150,16 +155,11 @@
fn e =>
((println o indent)
[str (header cfg ^ " failed."),
- case e of
- Failure doc => doc <^> dot
- | _ =>
- indent [str "Unhandled exception",
- str (Exn.message e) <^> dot],
- case Exn.history e of
- [] =>
- str "No exception history available."
- | hs => (indent o map str)
- ("Exception history:"::hs)]
+ case e
+ of Failure doc => doc <^> dot
+ | _ => indent [str "Unhandled exception",
+ str (Exn.message e) <^> dot],
+ history e <^> dot]
; false)))
fun testEq t th = test (verifyEq t o th)
@@ -242,7 +242,8 @@
handle e =>
G.return (SOME false, [],
[named t "with" v,
- named exn "raised" e]) ?))
+ named exn "raised" e <^> dot,
+ history e]) ?))
fun that b = G.return (SOME b, [], [])
val skip : law = G.return (NONE, [], [])
More information about the MLton-commit
mailing list