Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Expecto/Expecto.fs
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,14 @@ module Impl =
let mutable logger = Log.create "Expecto"
let setLogName name = logger <- Log.create name

let rec private exnWithInnerMsg (ex: exn) msg =
let currentMsg =
msg + (sprintf "%s%s" Environment.NewLine (ex.ToString()))
if isNull ex.InnerException then
currentMsg
else
exnWithInnerMsg ex.InnerException currentMsg

type TestResult =
| Passed
| Ignored of string
Expand All @@ -454,7 +462,7 @@ module Impl =
| Passed -> "Passed"
| Ignored reason -> "Ignored: " + reason
| Failed error -> "Failed: " + error
| Error e -> "Exception: " + e.ToString()
| Error e -> "Exception: " + exnWithInnerMsg e ""
member x.tag =
match x with
| Passed -> 0
Expand Down