-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 tests for org.asynchttpclient.netty.util.ByteBufUtils #1639
Add unit tests for org.asynchttpclient.netty.util.ByteBufUtils #1639
Conversation
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.
Thanks for contributing. Could you please address comments?
netty-utils/src/test/java/org/asynchttpclient/netty/util/ByteBufUtilsTests.java
Show resolved
Hide resolved
netty-utils/src/test/java/org/asynchttpclient/netty/util/ByteBufUtilsTests.java
Outdated
Show resolved
Hide resolved
netty-utils/src/test/java/org/asynchttpclient/netty/util/ByteBufUtilsTests.java
Outdated
Show resolved
Hide resolved
ByteBuf byteBuf2 = Unpooled.copiedBuffer(new byte[]{'o'}); | ||
|
||
ArrayAsserts.assertArrayEquals(new char[]{}, ByteBufUtils | ||
.byteBuf2Chars(Charset.forName("ISO-8859-1"), byteBuf1)); |
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 use ISO-8859-1 and not US-ASCII?
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.
As I was trying to cover the branch decodeChars(buf, charset)
in the byteBuf2Chars(Charset charset, ByteBuf buf)
method.
netty-utils/src/test/java/org/asynchttpclient/netty/util/ByteBufUtilsTests.java
Outdated
Show resolved
Hide resolved
fe3e2e0
to
8b10510
Compare
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.
Please address last comment and we'll be good to go. Thanks!
netty-utils/src/test/java/org/asynchttpclient/netty/util/ByteBufUtilsTests.java
Outdated
Show resolved
Hide resolved
These tests were written using Diffblue Cover.
8b10510
to
5824732
Compare
Hi @slandelle just following up and wondering if you would like me to make any changes to the PR? |
Thanks! |
I've analysed your codebase and noticed that
org.asynchttpclient.netty.util.ByteBufUtils
is not fully tested.I've written some tests for the methods in this class with the help of Diffblue Cover.
Hopefully, these tests will help you detect any regressions caused by future code changes. If you would find it useful to have additional tests written for this repository, I would be more than happy to look at other classes that you consider important.