aboutsummaryrefslogtreecommitdiff
path: root/test/Tests/Readers/Org
diff options
context:
space:
mode:
Diffstat (limited to 'test/Tests/Readers/Org')
-rw-r--r--test/Tests/Readers/Org/Block/Header.hs13
-rw-r--r--test/Tests/Readers/Org/Directive.hs23
2 files changed, 36 insertions, 0 deletions
diff --git a/test/Tests/Readers/Org/Block/Header.hs b/test/Tests/Readers/Org/Block/Header.hs
index 6f38714cd..913c830d6 100644
--- a/test/Tests/Readers/Org/Block/Header.hs
+++ b/test/Tests/Readers/Org/Block/Header.hs
@@ -205,5 +205,18 @@ tests =
, " :END:"
] =?>
headerWith ("look", [], []) 1 "important"
+
+ , "Planning info followed by test" =:
+ T.unlines [ "* important "
+ , " " <> T.unwords
+ [ "CLOSED: [2018-09-05 Wed 13:58]"
+ , "DEADLINE: <2018-09-17 Mon>"
+ , "SCHEDULED: <2018-09-10 Mon>"
+ ]
+ , " :PROPERTIES:"
+ , " :custom_id: look"
+ , " :END:"
+ ] =?>
+ headerWith ("look", [], []) 1 "important"
]
]
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"