Skip to content

Commit 41153da

Browse files
committed
Fix new exception type MatchException -> EqualException.ForMismatchedValues, thanks XUnit for making incompatible changes without first deprecating types
See fsprojects/FsUnit#240 for the FsUnit change (2nd commit) and fsprojects/FsUnit#251, and https://xunit.net/releases/v2/2.5.0
1 parent b15f6b3 commit 41153da

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/FSharp.Control.TaskSeq.Test/Nunit.Extensions.fs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ module ExtraCustomMatchers =
2222
let private baseResultTypeTest value =
2323
match value with
2424
| null ->
25-
MatchException("Result type", "<null>", "Value <null> or None is never Result.Ok or Result.Error")
25+
EqualException.ForMismatchedValues(
26+
"Result type",
27+
"<null>",
28+
"Value <null> or None is never Result.Ok or Result.Error"
29+
)
2630
|> raise
2731

2832
| _ ->
@@ -31,7 +35,7 @@ module ExtraCustomMatchers =
3135
if ty.FullName.StartsWith "Microsoft.FSharp.Core.FSharpResult" then
3236
FSharpValue.GetUnionFields(value, ty) |> fst
3337
else
34-
MatchException("Result type", ty.Name, "Type must be Result<_, _>")
38+
EqualException.ForMismatchedValues("Result type", ty.Name, "Type must be Result<_, _>")
3539
|> raise
3640

3741
let private baseOptionTypeTest value =
@@ -49,9 +53,13 @@ module ExtraCustomMatchers =
4953
| "None" -> None
5054
| _ ->
5155
raise
52-
<| MatchException("Option type", ty.Name, "Unexpected field name for F# option type")
56+
<| EqualException.ForMismatchedValues(
57+
"Option type",
58+
ty.Name,
59+
"Unexpected field name for F# option type"
60+
)
5361
else
54-
MatchException("Option type", ty.Name, "Type must be Option<_>")
62+
EqualException.ForMismatchedValues("Option type", ty.Name, "Type must be Option<_>")
5563
|> raise
5664

5765

0 commit comments

Comments
 (0)