Skip to content

Commit

Permalink
Issue checkstyle#12441: Resolve Pitest suppression for RightCurlyCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
arinmodi committed Nov 23, 2022
1 parent 55e09e5 commit e5b77a6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
9 changes: 0 additions & 9 deletions .ci/pitest-suppressions/pitest-blocks-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,6 @@
<lineContent>switch (ast.getType()) {</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>RightCurlyCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck$Details</mutatedClass>
<mutatedMethod>getDetailsForIfElse</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.NonVoidMethodCallMutator</mutator>
<description>removed call to com/puppycrawl/tools/checkstyle/checks/blocks/RightCurlyCheck$Details::getNextToken</description>
<lineContent>nextToken = getNextToken(ast);</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>RightCurlyCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck$Details</mutatedClass>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public void testAlone() throws Exception {
"184:9: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 9),
"189:9: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 9),
"190:53: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 53),
"221:12: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 12),
};
verifyWithInlineConfigParser(
getPath("InputRightCurlyLeftTestAlone.java"), expected);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,15 @@ interface Interface3 {
interface Interface4 {
void myMethod();
}} // ok

public void test() {
int id = 0;
switch (id) {
case 0: break;
case 1: if (1 == 0) {
break;
}; // violation ''}' at column 12 should be alone on a line.'
case 2: break;
}
}
}

0 comments on commit e5b77a6

Please sign in to comment.