Skip to content
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

Added more tests for skipUnquotedValues() #2082

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

oskaredv
Copy link

Five new tests that increase the branch coverage of skipUnquotedValues() by covering five branches of the method that was not covered yet

@Marcono1234
Copy link
Collaborator

Might be good to add some kind of assertion after the skipValue(); calls to make sure it actually had an effect. However, since these cases all seem to represent invalid lenient JSON, I am not sure if there is a way to perform any reasonable assertion; maybe checking JsonReader.getPath() would work at least.

Feel free to only consider this a suggestion; I am not a member of this project.

Added assertion with getPath() and getPreviousPath after skipValue() in two of the new tests
@oskaredv
Copy link
Author

oskaredv commented Feb 26, 2022

Thanks for the suggestion! I initially tried to add assertions after skipValue(), but did not manage to do it since the cases represent invalid lenient JSON. With JsonReader.getPath()and JsonReader.getPreviousPath() I managed to add assertions after skipValue() in two of the tests. For the other three JsonReader.getPath() returned null values after skipValue() and I did not know what do to with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants