Skip to content

Commit a9d1b48

Browse files
committed
Parse scheduling on every specific date
1 parent da53fb1 commit a9d1b48

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

test/schedule_parser_test.janet

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919
- Meeting with Jack (on 2022-05-03)
2020
- Review logs (every last day)
2121
- Send invoice (every last weekday)
22+
- Pay bills (every month on 15)
2223
```)
2324
(def result (schedule_parser/parse schedule-string))
2425
(def scheduled-tasks (result :tasks))
25-
(test (length scheduled-tasks) 8)
26+
(test (length scheduled-tasks) 9)
2627
(let [task (scheduled-tasks 0)]
2728
(test (task :title) "Weekly Meeting")
2829
(test (task :done) false)
@@ -38,7 +39,10 @@
3839
(test (task :schedule) "every last day"))
3940
(let [task (scheduled-tasks 7)]
4041
(test (task :title) "Send invoice")
41-
(test (task :schedule) "every last weekday")))
42+
(test (task :schedule) "every last weekday"))
43+
(let [task (scheduled-tasks 8)]
44+
(test (task :title) "Pay bills")
45+
(test (task :schedule) "every month on 15")))
4246

4347
(deftest "returns an error when the schedule can't be parsed"
4448
(def schedule-string

0 commit comments

Comments
 (0)