This commit is contained in:
Looly
2022-03-27 20:01:02 +08:00
parent c2e1bbafc8
commit 5966dcc626
13 changed files with 300 additions and 326 deletions

View File

@@ -122,6 +122,14 @@ public class CronPatternTest {
assertMatch(pattern, "2017-02-19 04:00:33");
}
@Test
public void patternNegativeTest() {
// -4表示倒数的数字此处在小时上-4表示 23 - 4为19
CronPattern pattern = CronPattern.of("* 0 -4 * * ?");
assertMatch(pattern, "2017-02-09 19:00:00");
assertMatch(pattern, "2017-02-19 19:00:33");
}
@Test
public void rangePatternTest() {
CronPattern pattern = CronPattern.of("* 20/2 * * * ?");