From 43cb73f00822da03e17674765f5114cee458fe92 Mon Sep 17 00:00:00 2001 From: Gustavo Leon <1261319+gusty@users.noreply.github.com> Date: Sat, 28 Nov 2020 19:49:43 +0100 Subject: [PATCH] Fix exception check on tests --- Test/Program.fs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Test/Program.fs b/Test/Program.fs index 92d9a80..a367714 100644 --- a/Test/Program.fs +++ b/Test/Program.fs @@ -171,7 +171,11 @@ let testTryFinallySadPath() = try t.Wait() with - | _ -> () + | :? AggregateException as e -> + match e.InnerExceptions |> Seq.toList with + | [TestException "uhoh"] -> () + | _ -> raise e + | e -> raise e require ran "never ran" let testTryFinallyCaught() = @@ -188,7 +192,11 @@ let testTryFinallyCaught() = ran <- true return 1 with - | _ -> return 2 + | TestException "uhoh" -> + return 2 + | e -> + raise e + return 3 } require (t.Result = 2) "wrong return" require ran "never ran"