Skip to content

Commit

Permalink
handle for inner ignore exception fixes #313
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Lloyd committed Apr 3, 2019
1 parent 743bac3 commit 03e9cad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Expecto.Tests/Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1256,6 +1256,10 @@ let taskTests =
let! m = Task.FromResult (3*n)
Expect.equal m 6 "m=6"
} |> assertTestFails

testTask "inner skip" {
skiptest "skipped"
}
]

[<Tests>]
Expand Down
5 changes: 4 additions & 1 deletion Expecto/Expecto.fs
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,10 @@ module Impl =
return TestSummary.single (Ignored e.Message) (float w.ElapsedMilliseconds)
| :? AggregateException as e when e.InnerExceptions.Count = 1 ->
w.Stop()
return TestSummary.single (Error e.InnerException) (float w.ElapsedMilliseconds)
if e.InnerException :? IgnoreException then
return TestSummary.single (Ignored e.InnerException.Message) (float w.ElapsedMilliseconds)
else
return TestSummary.single (Error e.InnerException) (float w.ElapsedMilliseconds)
| e ->
w.Stop()
return TestSummary.single (Error e) (float w.ElapsedMilliseconds)
Expand Down

0 comments on commit 03e9cad

Please sign in to comment.