-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Handle unicode and e-notation differences between S.T.J and J.N tests #35042
Conversation
Tagging subscribers to this area: @jozkee |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@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