Skip to content

Commit

Permalink
Issue checkstyle#12314: Resolve Pitest suppression for misc profile
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin222004 committed Oct 21, 2022
1 parent ad27aa0 commit ead4fbd
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 19 deletions.
18 changes: 0 additions & 18 deletions .ci/pitest-suppressions/pitest-misc-suppressions.xml
Expand Up @@ -36,24 +36,6 @@
<lineContent>log(1, MSG_KEY_WRONG_ENDING, file.getPath());</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>NewlineAtEndOfFileCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck</mutatedClass>
<mutatedMethod>setLineSeparator</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.NakedReceiverMutator</mutator>
<description>replaced call to java/lang/String::toUpperCase with receiver</description>
<lineContent>.toUpperCase(Locale.ENGLISH));</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>NewlineAtEndOfFileCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck</mutatedClass>
<mutatedMethod>setLineSeparator</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.NakedReceiverMutator</mutator>
<description>replaced call to java/lang/String::trim with receiver</description>
<lineContent>Enum.valueOf(LineSeparatorOption.class, lineSeparatorParam.trim()</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>OrderedPropertiesCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.OrderedPropertiesCheck</mutatedClass>
Expand Down
Expand Up @@ -212,6 +212,14 @@ public void testWrongSeparatorLength() throws Exception {
}
}

@Test
public void testTrimOptionProperty() throws Exception {
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
verifyWithInlineConfigParser(
getPath("InputNewlineAtEndOfFileTestTrimProperty.java"),
expected);
}

private static final class ReadZeroRandomAccessFile extends RandomAccessFile {

private ReadZeroRandomAccessFile(String name, String mode)
Expand Down
@@ -1,6 +1,6 @@
/*
NewlineAtEndOfFile
lineSeparator = CRLF
lineSeparator = crlf
fileExtensions = (default)all files
Expand Down
@@ -0,0 +1,18 @@
/*
NewlineAtEndOfFile
lineSeparator = \tcrlf
fileExtensions = all files
*/

package com.puppycrawl.tools.checkstyle.checks.newlineatendoffile;

/**
* Test case for detection of an existing CRLF newline at EOF, using the
* NewlineAtEndOfFileCheck.
* @author Martin Steiger
**/
public interface InputNewlineAtEndOfFileTestTrimProperty // ok
{
}

0 comments on commit ead4fbd

Please sign in to comment.