-
Notifications
You must be signed in to change notification settings - Fork 1k
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
jsoniter: Fix errors during reading integers from chunked io.Reader #477
jsoniter: Fix errors during reading integers from chunked io.Reader #477
Conversation
Codecov Report
@@ Coverage Diff @@
## master #477 +/- ##
=======================================
Coverage 86.29% 86.29%
=======================================
Files 41 41
Lines 5115 5115
=======================================
Hits 4414 4414
Misses 560 560
Partials 141 141
Continue to review full report at Codecov.
|
Thanks for the bug report and the pr. I will check it in the next few days. |
@AllenX2018 any updates plz 🙏 ? We already using our fork with the current PR branch for a couple of weeks in production and we haven't noticed any issues. |
Hi! Sorry for the late reply. I leave a review comment and please check it. |
iter_int_test.go
Outdated
@@ -0,0 +1,101 @@ | |||
package jsoniter_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.
Could you move this test case to the jsoniter_int_test.go under misc_tests directory?
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.
Done. Wasn't sure originally where to place this test 🤷
This commit fixes bug in Iterator.assertInteger method if the next conditions are met: - Iterator reads data from `io.Reader`, - expected value is `0` (zero) - `Iterator.tail == Iterator.head + 1` - `Iterator.tail < len(Iterator.buf)` - value in the buffer after `Iterator.tail` is presented from the previous read and has '.' character. Typical error which user cal see is: - assertInteger: can not decode float as int, error found in #X byte of ... Regression test added for checking the correct behaviour. Fixes json-iterator#476
ae689be
to
cd30fdf
Compare
Merged. Thanks! |
…son-iterator#477) This commit fixes bug in Iterator.assertInteger method if the next conditions are met: - Iterator reads data from `io.Reader`, - expected value is `0` (zero) - `Iterator.tail == Iterator.head + 1` - `Iterator.tail < len(Iterator.buf)` - value in the buffer after `Iterator.tail` is presented from the previous read and has '.' character. Typical error which user cal see is: - assertInteger: can not decode float as int, error found in #X byte of ... Regression test added for checking the correct behaviour. Fixes json-iterator#476
This commit fixes bug in Iterator.assertInteger method if the next
conditions are met:
io.Reader
,0
(zero)Iterator.tail == Iterator.head + 1
Iterator.tail < len(Iterator.buf)
Iterator.tail
is presented from the previous read and has '.' character.Typical error which user cal see is:
Regression test added for checking the correct behaviour.
Fixes #476