-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
Issue #10924: Checks that use getLine() should check code points for spaces #10976
Conversation
I also redefined |
Hello, @nmancus1 Pitest are failing, on inspecting it seems like new method |
How to generate regression report? |
src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractCheck.java
Outdated
Show resolved
Hide resolved
@MUzairS15 take a look at https://github.com/checkstyle/contribution/tree/master/checkstyle-tester#report-generation, this section outlines report generation process. For an example, see #10838 |
|
src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/SingleSpaceSeparatorCheck.java
Outdated
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAfterCheck.java
Outdated
Show resolved
Hide resolved
Sir, I am new here how can I work on this problem? |
I am already working on this. |
Still not able to meet coverage in SingleSpaceSeparator in |
thinks about age case that you can create in Input file to cover them, attentively read coverage report to understand what exactlt is not covered. |
82c7cef
to
f6d8b28
Compare
af80a4f
to
218f75f
Compare
I realised, I missed test for overloaded |
@MUzairS15 please make all other CI happy, then we will take a look at failing pitest. Also, it would be good if you could leave a "review" (comment) on any suppressions that you have added explaining why they are needed. Edit: do not worry about failure in semaphore |
1cd6c6a
to
21ba187
Compare
I need a empty array to be created, to test 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.
Few things to start with:
@@ -364,6 +369,13 @@ public void testIsBlank() { | |||
assertFalse(CommonUtil.isBlank("string"), "Should return false when string is not empty"); | |||
} | |||
|
|||
@Test | |||
public void testIsBlankCodePoint() { | |||
final int[] input = {115, 116, 114, 105, 110, 103}; |
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 make all code point array initializations in tests like:
... = "my string here".codePoints().toArray();
Tests also serve as documentation; this will make these tests much easier to read (and write).
This should help with #10976 (comment) also.
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.
ok
* Contains String Utility methods. | ||
* | ||
*/ | ||
public final class StringUtil { |
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.
Let's call this CodePointUtil
, since all methods deal with int
/ int []
type and not String
.
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.
Done
215805c
to
63e2650
Compare
@MUzairS15 , please do not resolve conversations, only author of comment can resolve them |
@MUzairS15 let's close this PR since we have decided to do separate PRs for #10924 in #10994 and others |
Closes #10924