aboutsummaryrefslogtreecommitdiff
path: root/tests/Tests/Readers/LaTeX.hs
blob: 58a27f09beaf999a9399ad00cf4a6c250852a611 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
module Tests.Readers.LaTeX (tests) where

import Text.Pandoc.Definition

import Test.Framework
import Tests.Shared

tests :: [Test]
tests = [ testGroup "basic" [ latexTest "simplest" "word"               
                              (Inline  $ Str "word") 
                              
                            , latexTest "space"    "some text"          
                              (Inlines $ [Str "some", Space, Str "text"])
                              
                            , latexTest "emphasis" "\\emph{emphasized}" 
                              (Inline  $ Emph [Str "emphasized"])
                            ]

        , testGroup "headers" [ latexTest "1. level"      "\\section{header}"       
                                $ Block $ Header 1 [Str "header"]

                              , latexTest "2. level"      "\\subsection{header}"    
                                $ Block $ Header 2 [Str "header"]

                              , latexTest "3. level"      "\\subsubsection{header}" 
                                $ Block $ Header 3 [Str "header"]

                              , latexTest "with emphasis" "\\section{text \\emph{emph}}"
                                $ Block $ Header 1 [Str "text", Space, Emph [Str "emph"]]

                              , latexTest "with link"     "\\section{text \\href{/url}{link}}"
                                $ Block $ Header 1 [Str "text", Space, Link [Str "link"] ("/url", "")]
                              ]
        ]