Skip to content

Commit 3b29ad7

Browse files
committed
Add failing tests for timestamps with headlines
1 parent 6601fa5 commit 3b29ad7

File tree

1 file changed

+108
-1
lines changed

1 file changed

+108
-1
lines changed

test/test_org.ml

+108-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,11 @@ let block =
210210
, check_aux
211211
":PROPERTIES:\n:XXX: 1\n:yyy: 2\n:END:\n#+ZZZ: 3\n#+UUU: 4"
212212
(Property_Drawer
213-
[ ("XXX", "1", []); ("yyy", "2", []); ("ZZZ", "3", []); ("UUU", "4", []) ]) )
213+
[ ("XXX", "1", [])
214+
; ("yyy", "2", [])
215+
; ("ZZZ", "3", [])
216+
; ("UUU", "4", [])
217+
]) )
214218
; ( "no drawer in quote"
215219
, `Quick
216220
, check_aux "#+BEGIN_QUOTE\na:: b\n#+END_QUOTE"
@@ -283,6 +287,109 @@ let block =
283287
; size = None
284288
}) )
285289
] )
290+
; ( "Headline with timestamps"
291+
, testcases
292+
[ ( "Schedule"
293+
, `Quick
294+
, check_aux "* aaa\nSCHEDULED: <1999-03-31 Wed>"
295+
(Type.Heading
296+
{ title = [ (I.Plain "aaa", None) ]
297+
; tags = []
298+
; marker = None
299+
; level = 1
300+
; numbering = None
301+
; priority = None
302+
; anchor = "aaa"
303+
; meta =
304+
{ Type.timestamps =
305+
[ I.Scheduled
306+
{ date = { day = 31; month = 3; year = 1999 }
307+
; time = None
308+
; repetition = None
309+
; wday = "Wed"
310+
; active = true
311+
}
312+
]
313+
; properties = []
314+
}
315+
; unordered = true
316+
; size = None
317+
}) )
318+
; ( "Schedule repeater"
319+
, `Quick
320+
, check_aux "* aaa\nSCHEDULED: <1999-03-31 Wed .+1y>"
321+
(Type.Heading
322+
{ title = [ (I.Plain "aaa", None) ]
323+
; tags = []
324+
; marker = None
325+
; level = 1
326+
; numbering = None
327+
; priority = None
328+
; anchor = "aaa"
329+
; meta =
330+
{ Type.timestamps =
331+
[ I.Scheduled
332+
{ date = { day = 31; month = 3; year = 1999 }
333+
; time = None
334+
; repetition = Some (Dotted, Year, 1)
335+
; wday = "Wed"
336+
; active = true
337+
}
338+
]
339+
; properties = []
340+
}
341+
; unordered = true
342+
; size = None
343+
}) )
344+
; ( "Schedule repeater and deadline"
345+
, `Quick
346+
, check_aux
347+
"* aaa [[link][label]] :bb:cc:\n\
348+
SCHEDULED: <1999-03-31 Wed 12:00-12:30 ++2w>\n\
349+
DEADLINE: <1999-04-01 Thu>"
350+
(Type.Heading
351+
{ title =
352+
[ (I.Plain "aaa ", None)
353+
; ( I.Link
354+
{ I.url = I.Search "link"
355+
; label = [ I.Plain "label" ]
356+
; title = None
357+
; full_text = "[[link][label]]"
358+
; metadata = ""
359+
}
360+
, None )
361+
]
362+
; tags = [ "bb"; "cc" ]
363+
; marker = None
364+
; level = 1
365+
; numbering = None
366+
; priority = None
367+
; anchor = "aaa_label"
368+
; meta =
369+
{ Type.timestamps =
370+
[ I.Scheduled
371+
{ date =
372+
{ day = 31; month = 3; year = 1999 }
373+
(* Having a time range like 12:00-12:30 doesn’t seem supported *)
374+
; time = Some { hour = 12; min = 0 }
375+
; repetition = Some (DoublePlus, Week, 2)
376+
; wday = "Wed"
377+
; active = true
378+
}
379+
; I.Deadline
380+
{ date = { day = 1; month = 4; year = 1999 }
381+
; time = None
382+
; repetition = None
383+
; wday = "Thu"
384+
; active = true
385+
}
386+
]
387+
; properties = []
388+
}
389+
; unordered = true
390+
; size = None
391+
}) )
392+
] )
286393
]
287394

288395
let () = Alcotest.run "mldoc" @@ List.concat [ block; inline ]

0 commit comments

Comments
 (0)