Skip to content

Commit

Permalink
ConTeXt writer: add test for --section-divs
Browse files Browse the repository at this point in the history
  • Loading branch information
hmenke committed Jan 24, 2018
1 parent c68345f commit fe496ad
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/Tests/Writers/ConTeXt.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ context' = unpack . purely (writeConTeXt def{ writerWrapText = WrapNone }) . toP
contextNtb :: (ToPandoc a) => a -> String
contextNtb = unpack . purely (writeConTeXt def{ writerExtensions = enableExtension Ext_ntb pandocExtensions }) . toPandoc

contextDiv :: (ToPandoc a) => a -> String
contextDiv = unpack . purely (writeConTeXt def{ writerSectionDivs = True }) . toPandoc

{-
"my test" =: X =?> Y
Expand Down Expand Up @@ -48,6 +51,29 @@ tests = [ testGroup "inline code"
, testGroup "headers"
[ "level 1" =:
headerWith ("my-header",[],[]) 1 "My header" =?> "\\section[title={My header},reference={my-header}]"
, test contextDiv "section-divs" $
( headerWith ("header1", [], []) 1 (text "Header1")
<> headerWith ("header2", [], []) 2 (text "Header2")
<> headerWith ("header3", [], []) 3 (text "Header3")
<> headerWith ("header4", [], []) 4 (text "Header4")
<> headerWith ("header5", [], []) 5 (text "Header5")
<> headerWith ("header6", [], []) 6 (text "Header6"))
=?>
unlines [ "\\startsection[title={Header1},reference={header1}]\n"
, "\\startsubsection[title={Header2},reference={header2}]\n"
, "\\startsubsubsection[title={Header3},reference={header3}]\n"
, "\\startsubsubsubsection[title={Header4},reference={header4}]\n"
, "\\startsubsubsubsubsection[title={Header5},reference={header5}]\n"
, "\\startsubsubsubsubsubsection[title={Header6},reference={header6}]\n"
, "\\stopsubsubsubsubsubsection\n"
, "\\stopsubsubsubsubsection\n"
, "\\stopsubsubsubsection\n"
, "\\stopsubsubsection\n"
, "\\stopsubsection\n"
, "\\stopsection" ]
--, test context "level 1" $
-- (headerWith ("my-header",[],[]) 1 (text "My header"))
-- =?> "\\section[title={My header},reference={my-header}]"
]
, testGroup "bullet lists"
[ "nested" =:
Expand Down

0 comments on commit fe496ad

Please sign in to comment.