Handle unicode and e-notation differences between S.T.J and J.N tests#35042
Handle unicode and e-notation differences between S.T.J and J.N tests#35042jozkee merged 10 commits intodotnet:masterfrom
Conversation
|
Tagging subscribers to this area: @jozkee |
jozkee
left a comment
There was a problem hiding this comment.
I would suggest to go for replacing the comparison against Json.Net with hardcoded strings as suggested in the issues description of #32350 unless there is a Json.Net configuration that allows you to get an output similar to System.Text.Json.
|
CI errors show that precision between Json.net and System.Text.Json also changes in some cases, any idea why is that? |
|
Can't seem to see why the CI is failing, just says Helix things. Anyone able to help? |
jozkee
left a comment
There was a problem hiding this comment.
Left some suggestions to consider.
Once we manage to enable this test, it will start to fail in .NET framework because of precision discrepancies on floating point values (see #435 (comment)). e.g: JsonSerializer.Serialize(123.45f) will produce 123.45 on .NET 5 but it will produce 123.449997 on .NET Framework.
At that point, I'm not sure if we should ifdef the floating point values to only apply for .NET 5.0 or disable the whole test from running on netfx.
|
@marcusturewicz, are you still working on this? Thanks. |
I'll have one more crack based on feedback above. |
|
@marcusturewicz can you please take a look at jozkee@5ef3af3? I think said change should suffice to finish up this PR. |
jozkee
left a comment
There was a problem hiding this comment.
Not sure why the CI is failing right now. Can you try to rebase on top of master to be as up-to-date as possible?
|
@marcusturewicz, thanks! |
I also ran into this also. It looks like the reader uses a higher-precision "G17" format which causes this issue on .NET Framework AFAIK. Here's my specific test: |
Fixes #32350