git.iko.soy/typeable/pandoc
on master help sign in
Put Org reader export option tests into test group
ad62578Albert Krewinkel
tests/Tests/Readers/Org.hs+65−61
@@ -602,69 +602,73 @@ tests =
602 ] =?>
602 ] =?>
603 (para (link "http://example.com/foo" "" "bar"))
603 (para (link "http://example.com/foo" "" "bar"))
604
604
605− , "Export option: Disable simple sub/superscript syntax" =:
606− unlines [ "#+OPTIONS: ^:nil"
607− , "a^b"
608− ] =?>
609− para "a^b"
610−
611− , "Export option: directly select drawers to be exported" =:
612− unlines [ "#+OPTIONS: d:(\"IMPORTANT\")"
613− , ":IMPORTANT:"
614− , "23"
615− , ":END:"
616− , ":BORING:"
617− , "very boring"
618− , ":END:"
619− ] =?>
620− divWith (mempty, ["IMPORTANT", "drawer"], mempty) (para "23")
621−
622− , "Export option: exclude drawers from being exported" =:
623− unlines [ "#+OPTIONS: d:(not \"BORING\")"
624− , ":IMPORTANT:"
625− , "5"
626− , ":END:"
627− , ":BORING:"
628− , "very boring"
629− , ":END:"
630− ] =?>
631− divWith (mempty, ["IMPORTANT", "drawer"], mempty) (para "5")
632−
633− , "Export option: don't include archive trees" =:
634− unlines [ "#+OPTIONS: arch:nil"
635− , "* old :ARCHIVE:"
636− ] =?>
637− (mempty ::Blocks)
638
605
606+ , testGroup "export options"
607+
608+ [ "disable simple sub/superscript syntax" =:
609+ unlines [ "#+OPTIONS: ^:nil"
610+ , "a^b"
611+ ] =?>
612+ para "a^b"
613+
614+ , "directly select drawers to be exported" =:
615+ unlines [ "#+OPTIONS: d:(\"IMPORTANT\")"
616+ , ":IMPORTANT:"
617+ , "23"
618+ , ":END:"
619+ , ":BORING:"
620+ , "very boring"
621+ , ":END:"
622+ ] =?>
623+ divWith (mempty, ["IMPORTANT", "drawer"], mempty) (para "23")
624+
625+ , "exclude drawers from being exported" =:
626+ unlines [ "#+OPTIONS: d:(not \"BORING\")"
627+ , ":IMPORTANT:"
628+ , "5"
629+ , ":END:"
630+ , ":BORING:"
631+ , "very boring"
632+ , ":END:"
633+ ] =?>
634+ divWith (mempty, ["IMPORTANT", "drawer"], mempty) (para "5")
635+
636+ , "don't include archive trees" =:
637+ unlines [ "#+OPTIONS: arch:nil"
638+ , "* old :ARCHIVE:"
639+ ] =?>
640+ (mempty ::Blocks)
641+
639− , "Export option: include complete archive trees" =:
642+ , "include complete archive trees" =:
640− unlines [ "#+OPTIONS: arch:t"
643+ unlines [ "#+OPTIONS: arch:t"
641− , "* old :ARCHIVE:"
644+ , "* old :ARCHIVE:"
642− , " boring"
645+ , " boring"
643− ] =?>
646+ ] =?>
644− let tagSpan t = spanWith ("", ["tag"], [("data-tag-name", t)]) mempty
647+ let tagSpan t = spanWith ("", ["tag"], [("data-tag-name", t)]) mempty
645− in mconcat [ headerWith ("old", [], mempty) 1 ("old" <> tagSpan "ARCHIVE")
648+ in mconcat [ headerWith ("old", [], mempty) 1 ("old" <> tagSpan "ARCHIVE")
646− , para "boring"
649+ , para "boring"
647− ]
650+ ]
648
651
649− , "Export option: include archive tree header only" =:
652+ , "include archive tree header only" =:
650− unlines [ "#+OPTIONS: arch:headline"
653+ unlines [ "#+OPTIONS: arch:headline"
651− , "* old :ARCHIVE:"
654+ , "* old :ARCHIVE:"
652− , " boring"
655+ , " boring"
653− ] =?>
656+ ] =?>
654− let tagSpan t = spanWith ("", ["tag"], [("data-tag-name", t)]) mempty
657+ let tagSpan t = spanWith ("", ["tag"], [("data-tag-name", t)]) mempty
655− in headerWith ("old", [], mempty) 1 ("old" <> tagSpan "ARCHIVE")
658+ in headerWith ("old", [], mempty) 1 ("old" <> tagSpan "ARCHIVE")
656−
659+
657− , "Export option: limit headline depth" =:
660+ , "limit headline depth" =:
658− unlines [ "#+OPTIONS: H:2"
661+ unlines [ "#+OPTIONS: H:2"
659− , "* section"
662+ , "* section"
660− , "** subsection"
663+ , "** subsection"
661− , "*** list item 1"
664+ , "*** list item 1"
662− , "*** list item 2"
665+ , "*** list item 2"
663− ] =?>
666+ ] =?>
664− mconcat [ headerWith ("section", [], []) 1 "section"
667+ mconcat [ headerWith ("section", [], []) 1 "section"
665− , headerWith ("subsection", [], []) 2 "subsection"
668+ , headerWith ("subsection", [], []) 2 "subsection"
666− , orderedList [ para "list item 1", para "list item 2" ]
669+ , orderedList [ para "list item 1", para "list item 2" ]
670+ ]
667− ]
671+ ]
668 ]
672 ]
669
673
670 , testGroup "Basic Blocks" $
674 , testGroup "Basic Blocks" $