-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FsUnit.Xunit : when using result type, on error, actual message is not showing the pretty printing but type info. #154
Comments
I think the investigation should start here |
I looked where the message "was ..." come from. This is when I stringify the actual value. The Result type string "Microsoft.FSharp.Core.FSharpResult`2[System.String,System.Object]" comes from when it's parsed through the CLR from F# to C# and gets stringified from C# code like here: https://github.com/nhamcrest/NHamcrest/blob/master/src/NHamcrest/Core/Matcher.cs#L11. I played around and got the solution which @cboudereau wrote down in "Known workarounds". It's an ugly parsing message from NHamcrest isn't it? @sergey-tihon When's ok then I would like to open a PR that basic implements the actual value as string without going the detour through NHamcrest. |
It possibly go right when NHamcrest has a F# version of the matcher. But NHamcrest wasn't updated for a long time so far. NHamcrest has actually |
I opened a PR #155 which will fix the "ugly" message. |
Fixed with #155. |
Description
When the unit test "should equal" failed, an error message indicates the pretty printing for the Expected but only type info the the Actual one.
Repro steps
Add the FsUnit.Xunit
add a unit test with :
Ok "hello" |> should equal (Ok "world")
Expected behavior
Expected result :
Actual behavior
Known workarounds
Related information
The text was updated successfully, but these errors were encountered: