Skip to content

Commit

Permalink
Issue checkstyle#3910: CommitValidationTest: add character limit to line
Browse files Browse the repository at this point in the history
  • Loading branch information
sagarshah94 authored and romani committed Mar 4, 2017
1 parent 8068599 commit f26c614
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -129,6 +129,11 @@ public void testCommitMessage() {
validateCommitMessage("minor: Test\n\n"));
assertEquals("should accept commit message that ends properly", 0,
validateCommitMessage("minor: Test. Test"));
assertEquals("should accept commit message with less than or equal to 200 characters",
4, validateCommitMessage("minor: Test Test Test Test Test"
+ "Test Test Test Test Test Test Test Test Test Test Test Test Test Test "
+ "Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test "
+ "Test Test Test Test Test Test Test Test Test Test Test Test Test"));
}

@Test
Expand Down Expand Up @@ -162,6 +167,10 @@ else if (INVALID_POSTFIX_PATTERN.matcher(message).matches()) {
// improper postfix
result = 3;
}
else if (message.length() > 200) {
// commit message has more than 200 characters
result = 4;
}
else {
result = 0;
}
Expand Down

0 comments on commit f26c614

Please sign in to comment.