aboutsummaryrefslogtreecommitdiff
path: root/tests/Latex/Reader.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Latex/Reader.hs')
-rw-r--r--tests/Latex/Reader.hs35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/Latex/Reader.hs b/tests/Latex/Reader.hs
new file mode 100644
index 000000000..d313b33eb
--- /dev/null
+++ b/tests/Latex/Reader.hs
@@ -0,0 +1,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", "")]
+ ]
+ ]
+