Skip to content

Commit 7d4ae23

Browse files
committed
test: add '1W,3W' interval test
Aren't failing as W-checks were redone, inserting days dynamically into calendar instead of looking up the next fitting day for each flag
1 parent d53220a commit 7d4ae23

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ccronexpr_test.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,13 +514,19 @@ void test_expr() {
514514
assert(check_next("0 0 12 1W,2W * ?","2025-01-01_11:00:00", "2025-01-01_12:00:00"));
515515
assert(check_next("0 0 12 1W,2W * ?","2025-01-01_13:01:00", "2025-01-02_12:00:00"));
516516
assert(check_next("0 0 12 1W,2W * ?","2025-01-02_12:01:00", "2025-02-03_12:00:00"));
517+
assert(check_next("0 0 12 1W,3W * ?","2025-01-01_11:00:00", "2025-01-01_12:00:00"));
518+
assert(check_next("0 0 12 1W,3W * ?","2025-01-01_13:01:00", "2025-01-03_12:00:00"));
519+
assert(check_next("0 0 12 1W,3W * ?","2025-01-03_12:01:00", "2025-02-03_12:00:00"));
517520
assert(check_next("0 0 12 1W,15W * ?","2025-01-01_11:00:00", "2025-01-01_12:00:00"));
518521
assert(check_next("0 0 12 1W,15W * ?","2025-01-01_13:01:00", "2025-01-15_12:00:00"));
519522
assert(check_next("0 0 12 1W,15W * ?","2025-01-15_12:01:00", "2025-02-03_12:00:00"));
520-
// Repeat for 1st May, also a wednesday
523+
// Repeat for 1st May, a thursday
521524
assert(check_next("0 0 12 1W,2W * ?","2025-05-01_11:00:00", "2025-05-01_12:00:00"));
522525
assert(check_next("0 0 12 1W,2W * ?","2025-05-01_13:01:00", "2025-05-02_12:00:00"));
523526
assert(check_next("0 0 12 1W,2W * ?","2025-05-02_12:01:00", "2025-06-02_12:00:00"));
527+
assert(check_next("0 0 12 1W,3W * ?","2025-05-01_11:00:00", "2025-05-01_12:00:00"));
528+
assert(check_next("0 0 12 1W,3W * ?","2025-05-01_13:01:00", "2025-05-02_12:00:00"));
529+
assert(check_next("0 0 12 1W,3W * ?","2025-05-02_12:01:00", "2025-06-02_12:00:00"));
524530
assert(check_next("0 0 12 1W,15W * ?","2025-05-01_11:00:00", "2025-05-01_12:00:00"));
525531
assert(check_next("0 0 12 1W,15W * ?","2025-05-01_13:01:00", "2025-05-15_12:00:00"));
526532
assert(check_next("0 0 12 1W,15W * ?","2025-05-15_12:01:00", "2025-06-02_12:00:00"));

0 commit comments

Comments
 (0)