Skip to content

Commit

Permalink
[JENKINS-25897] Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-beck committed Dec 23, 2014
1 parent 9a8329e commit b090751
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions core/src/test/java/hudson/scheduler/CronTabTest.java
Expand Up @@ -280,4 +280,25 @@ public int next(int n) {
assertEquals("[35, 56]", times.toString());
}

@Test public void rangeBoundsCheckOK() throws Exception {
new CronTab("H(0-59) H(0-23) H(1-31) H(1-12) H(0-7)");
}

@Test public void rangeBoundsCheckFailHour() throws Exception {
try {
new CronTab("H H(12-24) * * *");
fail();
} catch (ANTLRException e) {
// ok
}
}

@Test public void rangeBoundsCheckFailMinute() throws Exception {
try {
new CronTab("H(33-66) * * * *");
fail();
} catch (ANTLRException e) {
// ok
}
}
}

0 comments on commit b090751

Please sign in to comment.