Repository navigation
compat: allow the tag option to round a negative fraction away from zero - #14
Merged
Merged
Conversation
The scheduled fuzz run found "-PT0,0000000000002H": jsonduration truncates it to 0, the format tag option rounds it through float64 to -1ns. That is the listed difference for fractions of hours and minutes, but the test only allowed it for positive durations. The library is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The scheduled fuzz run on main failed on
"-PT0,0000000000002H": jsonduration reads 0, theformattag option reads -1ns.This is the negative twin of a difference already listed in
TestDifferencesFromFormatTag: jsonduration truncates fractions of hours and minutes exactly, encoding/json/v2 rounds them throughfloat64. The test allowed it only aswant-got == 1, which holds for positive durations alone.TestDifferencesFromFormatTag, a fuzz seed, and the failing corpus file.The library is unchanged.
just compat,just lintand a 60sjust compat-fuzzon this target pass.