aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java')
-rw-r--r--src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java
index 2aafd1e76..c1b6aecdc 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java
@@ -80,6 +80,27 @@ public class TrailingCommentCheckTest extends AbstractModuleTestSupport {
}
@Test
+ public void testFormat() throws Exception {
+ final DefaultConfiguration checkConfig = createModuleConfig(TrailingCommentCheck.class);
+ checkConfig.addAttribute("format", "NOT MATCH");
+ final String[] expected = {
+ "4: " + getCheckMessage(MSG_KEY),
+ "5: " + getCheckMessage(MSG_KEY),
+ "6: " + getCheckMessage(MSG_KEY),
+ "7: " + getCheckMessage(MSG_KEY),
+ "8: " + getCheckMessage(MSG_KEY),
+ "13: " + getCheckMessage(MSG_KEY),
+ "14: " + getCheckMessage(MSG_KEY),
+ "15: " + getCheckMessage(MSG_KEY),
+ "18: " + getCheckMessage(MSG_KEY),
+ "19: " + getCheckMessage(MSG_KEY),
+ "26: " + getCheckMessage(MSG_KEY),
+ "29: " + getCheckMessage(MSG_KEY),
+ };
+ verify(checkConfig, getPath("InputTrailingComment.java"), expected);
+ }
+
+ @Test
public void testCallVisitToken() {
final TrailingCommentCheck check = new TrailingCommentCheck();
try {