Skip to content

Commit dcdb521

Browse files
committed
Add test for scheduling task on last day of month
1 parent 06a4dd1 commit dcdb521

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

test/commands/schedule_tasks_test.janet

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,23 @@
6666
(is (not (scheduled-for? task (d/date 2022 2 1))))
6767
(is (not (scheduled-for? task (d/date 2023 1 27)))))
6868

69+
(deftest scheduled-for-last-day-of-month
70+
(def task (task/build-scheduled-task "Review logs" "every last day"))
71+
(is (scheduled-for? task (d/date 2022 1 31)))
72+
(is (scheduled-for? task (d/date 2022 2 28)))
73+
(is (scheduled-for? task (d/date 2022 3 31)))
74+
(is (scheduled-for? task (d/date 2022 4 30)))
75+
(is (scheduled-for? task (d/date 2022 5 31)))
76+
(is (scheduled-for? task (d/date 2022 6 30)))
77+
(is (scheduled-for? task (d/date 2022 7 31)))
78+
(is (scheduled-for? task (d/date 2022 8 31)))
79+
(is (scheduled-for? task (d/date 2022 9 30)))
80+
(is (scheduled-for? task (d/date 2022 10 31)))
81+
(is (scheduled-for? task (d/date 2022 11 30)))
82+
(is (scheduled-for? task (d/date 2022 12 31)))
83+
(is (scheduled-for? task (d/date 2023 1 31)))
84+
(is (not (scheduled-for? task (d/date 2022 1 30)))))
85+
6986
## —————————————————————————————————————————————————————————————————————————————————————————————————
7087
## Test missed?
7188

0 commit comments

Comments
 (0)