-
Notifications
You must be signed in to change notification settings - Fork 72
Address edge cases and add tests #30
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
Conversation
|
||
#define isOpenBracket_( x ) ( ( ( x ) == '{' ) || ( ( x ) == '[' ) ) | ||
#define isCloseBracket_( x ) ( ( ( x ) == '}' ) || ( ( x ) == ']' ) ) | ||
/* NB. The numeric values of the open and close bracket pairs differ by 2. */ |
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.
What does "NB" stand for?
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.
Nota bene
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.
May be esoteric for readers?
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.
We use e.g. and i.e. often enough. I'll keep it.
CUT_AFTER_OBJECT_START_MARKER_LENGTH ); | ||
TEST_ASSERT_EQUAL( JSONPartial, jsonStatus ); | ||
|
||
jsonStatus = JSON_Validate( CUT_AFTER_KEY, |
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.
Why was this removed?
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.
With the changes to the parser, a key without a value is considered illegal, not partial. The case is also covered by one of the new tests.
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.
Also, I put the test back with the other illegal tests.
This PR solves 3 edge cases and adds unit tests to prevent future regressions.