use of com.puppycrawl.tools.checkstyle.checks.AvoidEscapedUnicodeCharactersCheck.MSG_KEY in project checkstyle by checkstyle.
the class AvoidEscapedUnicodeCharactersCheckTest method testAllowEscapesForControlCharacterSetForAllCharacters.
@Test
public void testAllowEscapesForControlCharacterSetForAllCharacters() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(AvoidEscapedUnicodeCharactersCheck.class);
checkConfig.addAttribute("allowEscapesForControlCharacters", "true");
final int indexOfStartLineInInputFile = 6;
final String message = getCheckMessage(MSG_KEY);
final String[] expected = IntStream.rangeClosed(0, 0xffff).parallel().filter(val -> !isControlCharacter(val)).mapToObj(msg -> indexOfStartLineInInputFile + msg + ": " + message).toArray(String[]::new);
verify(checkConfig, getPath("InputAllEscapedUnicodeCharacters.java"), expected);
}
Aggregations