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

enhance ut for server #882

Merged
merged 1 commit into from
Jan 18, 2019
Merged

enhance ut for server #882

merged 1 commit into from
Jan 18, 2019

Conversation

andyxning
Copy link
Contributor

Changes proposed in this pull request:

  • enhance ut with more possible cases for TestParseSize and TestParseSInt64

/cc @nats-io/core

@coveralls
Copy link

coveralls commented Jan 17, 2019

Coverage Status

Coverage increased (+0.07%) to 91.785% when pulling 79c6f9e on andyxning:enhance_ut into f382fb8 on nats-io:master.

Copy link
Member

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

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

LGTM! Just don't add the \n in t.Fatalf() calls..


n = []byte("12345invalid678")
if pn := parseSize(n); pn != -1 {
t.Fatalf("Should error on %q, res=%d\n", n, pn)
Copy link
Member

Choose a reason for hiding this comment

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

You don't need the \n at the end. Same for the other that you added. I know that it is in the existing test code but we try not to add them in new code.


n = []byte("12345invalid678")
if pn := parseInt64(n); pn != -1 {
t.Fatalf("Should error on %q, res=%d\n", n, pn)
Copy link
Member

Choose a reason for hiding this comment

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

Remove \n on t.Fatalf and we should be good.

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

RemoVe new lines on t.Fatalf calls. Otherwise LGTM.

@andyxning
Copy link
Contributor Author

@derekcollison Done. PTAL.

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@derekcollison derekcollison merged commit 4de8d48 into nats-io:master Jan 18, 2019
@andyxning andyxning deleted the enhance_ut branch January 18, 2019 13:55
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.

None yet

4 participants