Skip to content
This repository has been archived by the owner on Aug 19, 2019. It is now read-only.

Streaming JSON parsing cleanup. #115

Merged
merged 8 commits into from
Apr 2, 2018
Merged

Conversation

igorpeshansky
Copy link
Member

These will make more sense if read one commit at a time.

)), json::Exception);
}

TEST(FromStringTest, Complete) {
Copy link
Contributor

@sparkprime sparkprime Apr 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can delete TEST(BigTest, RealisticParsing) now

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, so I can. Done.

Copy link
Contributor

@supriyagarg supriyagarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor comments.

});
}

TEST(FromStreamTest, Complete) {
Copy link
Contributor

@supriyagarg supriyagarg Apr 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complete -> SingleObject for similarity with previous tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FromStream only supports a single object, so that seems a bit redundant. But ok.

});
}

TEST(FromStreamTest, ExpectSingle) {
Copy link
Contributor

@supriyagarg supriyagarg Apr 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similarly:
ExpectSingle -> MultipleObjectsThrowsError

Makes it clear we are testing similar inputs across multiple methods.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Done.

)), json::Exception);
}

TEST(FromStringTest, Complete) {
Copy link
Contributor

@supriyagarg supriyagarg Apr 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto as above:
Complete -> SingleObject

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

});
}

TEST(FromStringTest, ExpectSingle) {
Copy link
Contributor

@supriyagarg supriyagarg Apr 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above:
ExpectSingle -> MultipleObjectsThrowsError

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

});
}

TEST(StreamingTest, ParseStreamThrowsOnParseErrorMidStream) {
Copy link
Contributor

@supriyagarg supriyagarg Apr 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this name (ParseStreamThrowsOnParseErrorMidStream) hard to understand.
Removing the "On" would be better.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, that would change the meaning I was trying to convey. Renamed — is this better?

Copy link
Member Author

@igorpeshansky igorpeshansky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PTAL.

});
}

TEST(FromStreamTest, Complete) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FromStream only supports a single object, so that seems a bit redundant. But ok.

});
}

TEST(FromStreamTest, ExpectSingle) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Done.

)), json::Exception);
}

TEST(FromStringTest, Complete) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, so I can. Done.

)), json::Exception);
}

TEST(FromStringTest, Complete) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

});
}

TEST(FromStringTest, ExpectSingle) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

});
}

TEST(StreamingTest, ParseStreamThrowsOnParseErrorMidStream) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, that would change the meaning I was trying to convey. Renamed — is this better?

Copy link
Contributor

@supriyagarg supriyagarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@sparkprime sparkprime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@igorpeshansky igorpeshansky merged commit 33685e7 into master Apr 2, 2018
@igorpeshansky igorpeshansky deleted the igorp-json-streaming-parser branch April 2, 2018 17:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants