Skip to content

Commit

Permalink
Issue checkstyle#11446: Update CheckerTest method testUnmappableChara…
Browse files Browse the repository at this point in the history
…cters
  • Loading branch information
LakshmiSowmya20 committed Apr 6, 2024
1 parent 5e2a2f0 commit d8c94d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
3 changes: 3 additions & 0 deletions config/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
files="TokenTypes.java|IndentationCheckTest.java|XdocsPagesTest|CheckerTest.java"
lines="1"/>


<suppress checks="LineLength" files="CheckerTest.java"/>

<!-- illegal words are part of Javadoc -->
<suppress checks="TodoComment" files=".*TodoCommentCheck\.java"/>

Expand Down
12 changes: 2 additions & 10 deletions src/test/java/com/puppycrawl/tools/checkstyle/CheckerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
import com.puppycrawl.tools.checkstyle.internal.utils.CloseAndFlushTestByteArrayOutputStream;
import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil;
import com.puppycrawl.tools.checkstyle.utils.CommonUtil;
import de.thetaphi.forbiddenapis.SuppressForbidden;

/**
* CheckerTest.
Expand Down Expand Up @@ -1656,20 +1655,13 @@ public void testCachedFile() throws Exception {
checker.destroy();
}

@SuppressForbidden
@Test
public void testUnmappableCharacters() throws Exception {
final String[] expected = {
"4: " + getCheckMessage(LineLengthCheck.class, MSG_KEY, 75, 238),
"4: " + getCheckMessage(LineLengthCheck.class, MSG_KEY, 80, 100),
};

final DefaultConfiguration checkConfig = createModuleConfig(LineLengthCheck.class);
checkConfig.addProperty("max", "75");

final DefaultConfiguration checkerConfig = createRootConfig(checkConfig);
checkerConfig.addProperty("charset", "IBM1098");

verify(checkerConfig, getPath("InputCheckerTestCharset.java"), expected);
verifyWithInlineXmlConfig(getPath("InputCheckerTestCharset.java"), expected);
}

@Test
Expand Down

0 comments on commit d8c94d6

Please sign in to comment.