Skip to content

Commit

Permalink
Issue checkstyle#12876: Resolve pitest suppression for AbstractViolat…
Browse files Browse the repository at this point in the history
…ionReporter
  • Loading branch information
ThatSneakyCoder authored and Sloent committed Apr 18, 2023
1 parent 708cd03 commit 8f4d9b9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
9 changes: 0 additions & 9 deletions config/pitest-suppressions/pitest-api-suppressions.xml
@@ -1,14 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<suppressedMutations>
<mutation unstable="false">
<sourceFile>AbstractViolationReporter.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter</mutatedClass>
<mutatedMethod>setSeverity</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.MemberVariableMutator</mutator>
<description>Removed assignment to member variable severityLevel</description>
<lineContent>severityLevel = SeverityLevel.getInstance(severity);</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>FileContents.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.api.FileContents</mutatedClass>
Expand Down
Expand Up @@ -241,6 +241,15 @@ public void testUnusedLocalVarNestedClasses3() throws Exception {
expected);
}

@Test
public void testUnusedLocalVarTestWarningSeverity() throws Exception {
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;

verifyWithInlineConfigParser(
getPath("InputUnusedLocalVariableTestWarningSeverity.java"),
expected);
}

@Test
public void testUnusedLocalVarEnum() throws Exception {
final String[] expected = {
Expand Down
@@ -0,0 +1,18 @@
/*
UnusedLocalVariable
severity = warning
*/

package com.puppycrawl.tools.checkstyle.checks.coding.unusedlocalvariable;

public class InputUnusedLocalVariableTestWarningSeverity {

void m() {
@Test.A Outer p1 = new @Test.A Outer();
@Test.A Outer.@Test.B Inner p2 = p1.new @Test.B Inner();
// ok above until https://github.com/checkstyle/checkstyle/issues/12980
}

}

0 comments on commit 8f4d9b9

Please sign in to comment.