From 275afec38a9feb1143344af19d5ebfbf4ef4fb32 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 6 Sep 2018 20:57:21 +0200 Subject: Org reader: respect export option `p` for planning info Inclusion of planning info (*DEADLINE*, *SCHEDULED*, and *CLOSED*) can be controlled via the `p` export option: setting the option to `t` will add all planning information in a *Plain* block below the respective headline. --- test/Tests/Readers/Org/Directive.hs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test/Tests/Readers/Org/Directive.hs') diff --git a/test/Tests/Readers/Org/Directive.hs b/test/Tests/Readers/Org/Directive.hs index bb9c52e69..87abb714d 100644 --- a/test/Tests/Readers/Org/Directive.hs +++ b/test/Tests/Readers/Org/Directive.hs @@ -150,6 +150,29 @@ tests = , "* Headline :hello:world:" ] =?> headerWith ("headline", [], mempty) 1 "Headline" + + , testGroup "planning information" + [ "include planning info after headlines" =: + T.unlines [ "#+OPTIONS: p:t" + , "* important" + , " DEADLINE: <2018-10-01 Mon> SCHEDULED: <2018-09-15 Sat>" + ] =?> + mconcat [ headerWith ("important", mempty, mempty) 1 "important" + , plain $ strong "DEADLINE:" + <> space + <> emph (str "<2018-10-01 Mon>") + <> space + <> strong "SCHEDULED:" + <> space + <> emph (str "<2018-09-15 Sat>") + ] + + , "empty planning info is not included" =: + T.unlines [ "#+OPTIONS: p:t" + , "* Wichtig" + ] =?> + headerWith ("wichtig", mempty, mempty) 1 "Wichtig" + ] ] , testGroup "Include" -- cgit v1.2.3