Skip to content

Commit

Permalink
Add failing tests for timestamps with headlines
Browse files Browse the repository at this point in the history
  • Loading branch information
gagbo committed Dec 31, 2023
1 parent 6601fa5 commit 85c2d00
Showing 1 changed file with 103 additions and 0 deletions.
103 changes: 103 additions & 0 deletions test/test_org.ml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,109 @@ let block =
; size = None
}) )
] )
; ( "Headline with timestamps"
, testcases
[ ( "Schedule"
, `Quick
, check_aux "* aaa\nSCHEDULED: <1999-03-31 Wed>"
(Type.Heading
{ title = [ (I.Plain "aaa", None) ]
; tags = [ ]
; marker = None
; level = 1
; numbering = None
; priority = None
; anchor = "aaa"
; meta = { Type.timestamps = [ I.Scheduled
{ date =
{ day = 31
; month = 3
; year = 1999
}
; time = None
; repetition = None
; wday = "Wed"
; active = true
} ]
; properties = [] }
; unordered = true
; size = None
}) )
; ( "Schedule repeater"
, `Quick
, check_aux "* aaa\nSCHEDULED: <1999-03-31 Wed .+1y>"
(Type.Heading
{ title = [ (I.Plain "aaa", None) ]
; tags = [ ]
; marker = None
; level = 1
; numbering = None
; priority = None
; anchor = "aaa"
; meta = { Type.timestamps = [ I.Scheduled
{ date =
{ day = 31
; month = 3
; year = 1999
}
; time = None
; repetition = Some (Dotted, Year, 1)
; wday = "Wed"
; active = true
} ]
; properties = [] }
; unordered = true
; size = None
}) )
; ( "Schedule repeater and deadline"
, `Quick
, check_aux "* aaa [[link][label]] :bb:cc:\nSCHEDULED: <1999-03-31 Wed 12:00-12:30 ++2w>\nDEADLINE: <1999-04-01 Thu>"
(Type.Heading
{ title =
[ (I.Plain "aaa ", None)
; ( I.Link
{ I.url = I.Search "link"
; label = [ I.Plain "label" ]
; title = None
; full_text = "[[link][label]]"
; metadata = ""
}
, None )
]
; tags = [ "bb"; "cc" ]
; marker = None
; level = 1
; numbering = None
; priority = None
; anchor = "aaa_label"
; meta = { Type.timestamps = [ I.Scheduled
{ date =
{ day = 31
; month = 3
; year = 1999
}
(* Having a time range like 12:00-12:30 doesn’t seem supported *)
; time = Some { hour = 12; min = 0 }
; repetition = Some (DoublePlus, Week, 2)
; wday = "Wed"
; active = true
}
; I.Deadline
{ date =
{ day = 1
; month = 4
; year = 1999
}
; time = None
; repetition = None
; wday = "Thu"
; active = true
} ]
; properties = [] }
; unordered = true
; size = None
}) )
] )
]

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

0 comments on commit 85c2d00

Please sign in to comment.