Skip to content

Commit 87b3d5e

Browse files
committed
Add test for parsing plan with event without tasks
1 parent 6e60693 commit 87b3d5e

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

test/plan/parser_test.janet

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,21 @@
204204
(test (task :title) "Fix the lamp")
205205
(test (task :done) true)))
206206

207+
(deftest "parses a plan with an event without any tasks"
208+
(def plan-string
209+
```
210+
# Main TODO
211+
212+
## 2020-07-30, Thursday
213+
214+
- Talked to Mike & Molly
215+
```)
216+
(def plan ((parse plan-string) :plan))
217+
(test (length (plan :days)) 1)
218+
(let [day ((plan :days) 0)
219+
event ((day :events) 0)]
220+
(test (event :title) "Talked to Mike & Molly")))
221+
207222
(deftest "returns an error when the plan can't be parsed"
208223
(def plan-string
209224
```

0 commit comments

Comments
 (0)