summaryrefslogtreecommitdiff
path: root/src/Tests/Readers/Markdown.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Tests/Readers/Markdown.hs')
-rw-r--r--src/Tests/Readers/Markdown.hs29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/Tests/Readers/Markdown.hs b/src/Tests/Readers/Markdown.hs
new file mode 100644
index 000000000..722a45bdb
--- /dev/null
+++ b/src/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")]) "*")
+ ]
+ ]