-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[TestJSONEncoder] Re-enable tests and add a special case for testEncodingDate
#23721
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
[TestJSONEncoder] Re-enable tests and add a special case for testEncodingDate
#23721
Conversation
@swift-ci smoke test |
2fdde84
to
6aed5ee
Compare
@swift-ci smoke test |
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.
Looks reasonable to me overall but I think we need to bail before the expectEqual
check, since it appears to be unconditional right now (so won't get us out of what we're trying to avoid here).
6aed5ee
to
2b88f6b
Compare
@swift-ci smoke test |
Ben, I realize it might be worth adding an explicit test along with this (inline) not just for |
@itai agreed... let me add a counter test here to ensure my new test works as expected. I can pull from the playground. |
…rare condition caused by `snprintf`'s `%g` which `JSONSerialization` uses internally for double values. This bug effects Darwin, FreeBSD, and Linux currently.
2b88f6b
to
c4ee047
Compare
@swift-ci smoke test |
} | ||
|
||
// Test the above `snprintf` edge case evaluation with a known triggering case | ||
let knownBadDate = Date(timeIntervalSinceReferenceDate: 0.0021413276231263384) |
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.
@itaiferber added this case which will always pass through the above edge case
Cool merging! |
Handles a rare condition caused by
snprintf
's%g
whichJSONSerialization
uses internally for double values. This bug effects Darwin, FreeBSD, and Linux currently.