aboutsummaryrefslogtreecommitdiff
path: root/tests/Latex/Reader.hs
blob: d313b33ebced90e903d5f97317b45f59059ef6b9 (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 Latex.Reader (tests) where

import Text.Pandoc.Definition

import Test.Framework
import Helpers

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", "")]
                              ]
        ]