-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Add unit test to make sure iterator_input_adapter advances iterators correctly #3548
Add unit test to make sure iterator_input_adapter advances iterators correctly #3548
Conversation
63f6eec
to
bb9eda1
Compare
@nlohmann @gregmarr This PR is a proactive step to make sure the iterator position after parsing reflects expectations [1]. I hope the parse API can be changed or amended in the future to return the iterator to where parsing stopped. This is in clear conflict with #3442, which aims to change this to point to the last processed character. [1] To be fair, those are my expectations but I believe they're reasonable. |
When parsing a string containing two JSON values using iterators, after parsing, iterator_input_adapter should have advanced to the first character of the second value. Add a unit test to check that this is true.
bb9eda1
to
3458089
Compare
@nlohmann Ping. Do you need me to do anything here? |
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 good to me.
Thanks for reminding me. |
When parsing a string containing two JSON values using iterators, after parsing,
iterator_input_adapter
should have advanced to the first character of the second value.The current API doesn't return the
first
iterator after parsing. To achieve the same effect aproxy_iterator
is added that advances the iterator passed by reference, even if the proxy is moved.