aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pandoc.cabal1
-rw-r--r--tests/Tests/Readers/Markdown.hs29
-rw-r--r--tests/test-pandoc.hs2
3 files changed, 32 insertions, 0 deletions
diff --git a/pandoc.cabal b/pandoc.cabal
index 739dc046f..977ea6b3a 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -354,6 +354,7 @@ Executable test-pandoc
Tests.Helpers
Tests.Arbitrary
Tests.Readers.LaTeX
+ Tests.Readers.Markdown
Tests.Readers.RST
Tests.Writers.Native
Tests.Writers.ConTeXt
diff --git a/tests/Tests/Readers/Markdown.hs b/tests/Tests/Readers/Markdown.hs
new file mode 100644
index 000000000..722a45bdb
--- /dev/null
+++ b/tests/Tests/Readers/Markdown.hs
@@ -0,0 +1,29 @@
+{-# LANGUAGE OverloadedStrings, QuasiQuotes #-}
+module Tests.Readers.Markdown (tests) where
+
+import Text.Pandoc.Definition
+import Test.Framework
+import Tests.Helpers
+import Tests.Arbitrary()
+import Text.Pandoc.Builder
+import Text.Pandoc
+
+markdown :: String -> Pandoc
+markdown = readMarkdown defaultParserState{ stateStandalone = True }
+
+infix 5 =:
+(=:) :: ToString c
+ => String -> (String, c) -> Test
+(=:) = test markdown
+
+tests :: [Test]
+tests = [ testGroup "inline code"
+ [ "with attribute" =:
+ "`document.write(\"Hello\");`{.javascript}"
+ =?> para
+ (codeWith ("",["javascript"],[]) "document.write(\"Hello\");")
+ , "with attribute space" =:
+ "`*` {.haskell .special x=\"7\"}"
+ =?> para (codeWith ("",["haskell","special"],[("x","7")]) "*")
+ ]
+ ]
diff --git a/tests/test-pandoc.hs b/tests/test-pandoc.hs
index d5e42f4d0..ea499dac6 100644
--- a/tests/test-pandoc.hs
+++ b/tests/test-pandoc.hs
@@ -6,6 +6,7 @@ import Test.Framework
import qualified Tests.Old
import qualified Tests.Readers.LaTeX
+import qualified Tests.Readers.Markdown
import qualified Tests.Readers.RST
import qualified Tests.Writers.ConTeXt
import qualified Tests.Writers.Native
@@ -18,6 +19,7 @@ tests = [ testGroup "Old" Tests.Old.tests
]
, testGroup "Readers"
[ testGroup "LaTeX" Tests.Readers.LaTeX.tests
+ , testGroup "Markdown" Tests.Readers.Markdown.tests
, testGroup "RST" Tests.Readers.RST.tests
]
]