aboutsummaryrefslogtreecommitdiff
path: root/tests/Tests/Readers
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2016-07-01 22:44:29 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2016-07-01 23:05:33 +0200
commitc4cf6d237f1017d36eeafad162570754506a6093 (patch)
treeb760ff99e162aed5a5e4892c7c53098f971cd8cc /tests/Tests/Readers
parent1ebaf6de117d74145a58d63a41a4c69b87aaa771 (diff)
downloadpandoc-c4cf6d237f1017d36eeafad162570754506a6093.tar.gz
Org reader: support archived trees export options
Handling of archived trees can be modified using the `arch` option. Archived trees are either dropped, exported completely, or collapsed to include just the header when the `arch` option is nil, non-nil, or `headline`, respectively.
Diffstat (limited to 'tests/Tests/Readers')
-rw-r--r--tests/Tests/Readers/Org.hs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs
index 7612d88f1..f57858a55 100644
--- a/tests/Tests/Readers/Org.hs
+++ b/tests/Tests/Readers/Org.hs
@@ -587,6 +587,30 @@ tests =
, ":END:"
] =?>
divWith (mempty, ["IMPORTANT", "drawer"], mempty) (para "5")
+
+ , "Export option: don't include archive trees" =:
+ unlines [ "#+OPTIONS: arch:nil"
+ , "* old :ARCHIVE:"
+ ] =?>
+ (mempty ::Blocks)
+
+ , "Export option: include complete archive trees" =:
+ unlines [ "#+OPTIONS: arch:t"
+ , "* old :ARCHIVE:"
+ , " boring"
+ ] =?>
+ let tagSpan t = spanWith ("", ["tag"], [("data-tag-name", t)]) mempty
+ in mconcat [ headerWith ("old", [], mempty) 1 ("old" <> tagSpan "ARCHIVE")
+ , para "boring"
+ ]
+
+ , "Export option: include archive tree header only" =:
+ unlines [ "#+OPTIONS: arch:headline"
+ , "* old :ARCHIVE:"
+ , " boring"
+ ] =?>
+ let tagSpan t = spanWith ("", ["tag"], [("data-tag-name", t)]) mempty
+ in headerWith ("old", [], mempty) 1 ("old" <> tagSpan "ARCHIVE")
]
, testGroup "Basic Blocks" $