diff options
Diffstat (limited to 'tests/Tests/Writers')
-rw-r--r-- | tests/Tests/Writers/Docbook.hs | 28 | ||||
-rw-r--r-- | tests/Tests/Writers/LaTeX.hs | 39 |
2 files changed, 52 insertions, 15 deletions
diff --git a/tests/Tests/Writers/Docbook.hs b/tests/Tests/Writers/Docbook.hs index f2a1e9d7b..a288242dc 100644 --- a/tests/Tests/Writers/Docbook.hs +++ b/tests/Tests/Writers/Docbook.hs @@ -236,11 +236,13 @@ tests = [ testGroup "line blocks" <> header 2 (text "header2") <> header 3 (text "header3") - docbookTopLevelDiv :: (ToPandoc a) => Division -> a -> String + docbookTopLevelDiv :: (ToPandoc a) + => TopLevelDivision -> a -> String docbookTopLevelDiv division = - docbookWithOpts def{ writerTopLevelDivision = Just division } + docbookWithOpts def{ writerTopLevelDivision = division } in - [ test (docbookTopLevelDiv Section) "sections as top-level" $ headers =?> + [ test (docbookTopLevelDiv TopLevelSection) "sections as top-level" $ + headers =?> unlines [ "<sect1>" , " <title>header1</title>" , " <sect2>" @@ -253,7 +255,8 @@ tests = [ testGroup "line blocks" , " </sect2>" , "</sect1>" ] - , test (docbookTopLevelDiv Chapter) "chapters as top-level" $ headers =?> + , test (docbookTopLevelDiv TopLevelChapter) "chapters as top-level" $ + headers =?> unlines [ "<chapter>" , " <title>header1</title>" , " <sect1>" @@ -266,7 +269,8 @@ tests = [ testGroup "line blocks" , " </sect1>" , "</chapter>" ] - , test (docbookTopLevelDiv Part) "parts as top-level" $ headers =?> + , test (docbookTopLevelDiv TopLevelPart) "parts as top-level" $ + headers =?> unlines [ "<part>" , " <title>header1</title>" , " <chapter>" @@ -279,6 +283,20 @@ tests = [ testGroup "line blocks" , " </chapter>" , "</part>" ] + , test (docbookTopLevelDiv TopLevelDefault) "default top-level" $ + headers =?> + unlines [ "<sect1>" + , " <title>header1</title>" + , " <sect2>" + , " <title>header2</title>" + , " <sect3>" + , " <title>header3</title>" + , " <para>" + , " </para>" + , " </sect3>" + , " </sect2>" + , "</sect1>" + ] ] ] ] diff --git a/tests/Tests/Writers/LaTeX.hs b/tests/Tests/Writers/LaTeX.hs index fb230e89a..d8bfa5924 100644 --- a/tests/Tests/Writers/LaTeX.hs +++ b/tests/Tests/Writers/LaTeX.hs @@ -88,45 +88,64 @@ tests = [ testGroup "code blocks" <> header 2 (text "header2") <> header 3 (text "header3") - latexTopLevelDiv :: (ToPandoc a) => Division -> a -> String + latexTopLevelDiv :: (ToPandoc a) => TopLevelDivision -> a -> String latexTopLevelDiv division = - latexWithOpts def{ writerTopLevelDivision = Just division } + latexWithOpts def{ writerTopLevelDivision = division } - beamerTopLevelDiv :: (ToPandoc a) => Division -> a -> String + beamerTopLevelDiv :: (ToPandoc a) + => TopLevelDivision -> a -> String beamerTopLevelDiv division = - latexWithOpts def { writerTopLevelDivision = Just division + latexWithOpts def { writerTopLevelDivision = division , writerBeamer = True } in - [ test (latexTopLevelDiv Section) "sections as top-level" $ headers =?> + [ test (latexTopLevelDiv TopLevelSection) + "sections as top-level" $ headers =?> unlines [ "\\section{header1}\n" , "\\subsection{header2}\n" , "\\subsubsection{header3}" ] - , test (latexTopLevelDiv Chapter) "chapters as top-level" $ headers =?> + , test (latexTopLevelDiv TopLevelChapter) + "chapters as top-level" $ headers =?> unlines [ "\\chapter{header1}\n" , "\\section{header2}\n" , "\\subsection{header3}" ] - , test (latexTopLevelDiv Part) "parts as top-level" $ headers =?> + , test (latexTopLevelDiv TopLevelPart) + "parts as top-level" $ headers =?> unlines [ "\\part{header1}\n" , "\\chapter{header2}\n" , "\\section{header3}" ] - , test (beamerTopLevelDiv Section) "sections as top-level in beamer" $ headers =?> + , test (latexTopLevelDiv TopLevelDefault) + "default top-level" $ headers =?> unlines [ "\\section{header1}\n" , "\\subsection{header2}\n" , "\\subsubsection{header3}" ] - , test (beamerTopLevelDiv Chapter) "chapters are as part in beamer" $ headers =?> + , test (beamerTopLevelDiv TopLevelSection) + "sections as top-level in beamer" $ headers =?> + unlines [ "\\section{header1}\n" + , "\\subsection{header2}\n" + , "\\subsubsection{header3}" + ] + , test (beamerTopLevelDiv TopLevelChapter) + "chapters are as part in beamer" $ headers =?> unlines [ "\\part{header1}\n" , "\\section{header2}\n" , "\\subsection{header3}" ] - , test (beamerTopLevelDiv Part) "parts as top-level in beamer" $ headers =?> + , test (beamerTopLevelDiv TopLevelPart) + "parts as top-level in beamer" $ headers =?> unlines [ "\\part{header1}\n" , "\\section{header2}\n" , "\\subsection{header3}" ] + , test (beamerTopLevelDiv TopLevelDefault) + "default top-level in beamer" $ headers =?> + unlines [ "\\section{header1}\n" + , "\\subsection{header2}\n" + , "\\subsubsection{header3}" + ] ] ] ] |