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 committed Apr 12, 2023
1 parent 9283e4c commit 18ad6f2
Show file tree
Hide file tree
Showing 3 changed files with 26 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,17 @@
/*
UnusedLocalVariable
severity = warning
*/

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

public class InputUnusedLocalVariableTestWarningSeverity {

void m() {
@Test.A Outer p1 = new @Test.A Outer(); // ok
@Test.A Outer.@Test.B Inner p2 = p1.new @Test.B Inner(); // ok
}

}

0 comments on commit 18ad6f2

Please sign in to comment.