Skip to content

Commit 43f7e04

Browse files
committed
Parse "every last weekday" schedule
1 parent 06e0732 commit 43f7e04

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
@@ -18,10 +18,11 @@
1818
- Martha's birthday (every 05-24)
1919
- Meeting with Jack (on 2022-05-03)
2020
- Review logs (every last day)
21+
- Send invoice (every last weekday)
2122
```)
2223
(def result (schedule_parser/parse schedule-string))
2324
(def scheduled-tasks (result :tasks))
24-
(test (length scheduled-tasks) 7)
25+
(test (length scheduled-tasks) 8)
2526
(let [task (scheduled-tasks 0)]
2627
(test (task :title) "Weekly Meeting")
2728
(test (task :done) false)
@@ -34,7 +35,10 @@
3435
(test (task :schedule) "on 2022-05-03"))
3536
(let [task (scheduled-tasks 6)]
3637
(test (task :title) "Review logs")
37-
(test (task :schedule) "every last day")))
38+
(test (task :schedule) "every last day"))
39+
(let [task (scheduled-tasks 7)]
40+
(test (task :title) "Send invoice")
41+
(test (task :schedule) "every last weekday")))
3842

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

0 commit comments

Comments
 (0)