From 0acf774011877a8de6363a79b4bb7a5b2ed83913 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 26 Jan 2011 22:09:09 -0800 Subject: Added Tests.Readers.Markdown. --- tests/Tests/Readers/Markdown.hs | 29 +++++++++++++++++++++++++++++ tests/test-pandoc.hs | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 tests/Tests/Readers/Markdown.hs (limited to 'tests') 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 ] ] -- cgit v1.2.3